daily pastebin goal
18%
SHARE
TWEET

[Perl 6] Returning multiple values.

cwchen Nov 15th, 2017 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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";
RAW Paste Data
Top