> On 1 Jul 2017, at 15:15, Gabor Szabo <[email protected]> wrote:
>
> I was hoping to wrote a simple script that would accept a bunch of
> filenames on the command line so I wrote:
>
> #!/usr/bin/env perl6
> use v6;
>
> multi sub MAIN(@files) {
> say @files.perl;
> }
This signature will only accept an Iterable. The command line parameters are
*not* considered a list, so this will not match. What you need is a slurpy
array:
multi sub MAIN(*@files) {
say @files.perl;
}
$ 6 'sub MAIN(*@a) { dd @a }' a b c d
["a", "b", "c", "d"]
Liz