daily pastebin goal
11%
SHARE
TWEET

[Perl 6] Returning multiple values.

cwchen Nov 15th, 2017 103 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
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top