Perl 6 Perl 6 Lists and Arrays vivified #51

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 © 2012
http://www.pmichaud.com/2012/pres/