Advertisement
cwchen

[Perl 6] Returning multiple values.

Nov 15th, 2017
3,019
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 6 0.15 KB | None | 0 0
  1. sub divmod(Int $a, Int $b) {
  2.     $a div $b, $a mod $b;
  3. }
  4.  
  5. my ($a, $b) = divmod(5, 3);
  6. $a == 1 or die "Wrong value";
  7. $b == 2 or die "Wrong value";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement