Perl 6 Perl 6 Lists, Arrays, and Hashes vivified #48

Passing lists as arguments

By default, arguments bind one-to-one without flattening:

sub foo($x, $y, $z) { ... }
my @lastwords = <Perl 6 rocks>;

foo(1,2,3);                      # ok
foo(@lastwords);                 # error, only one arg

Use prefix-| to flatten into an argument list

foo(|@lastwords);                # okay, flattened to three args
Copyright © 2011
http://www.pmichaud.com/2011/pres/