Advertisement
cwchen

[Perl 6] Flattening an array.

Nov 15th, 2017
1,207
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub add($x, $y) {
  2.     $x + $y;
  3. }
  4.  
  5. my @arr = (3, 4);
  6. my $sum = add(|@arr);
  7. $sum == 7 or die "Wrong value";
Advertisement
RAW Paste Data Copied
Advertisement