Re: list named argument in MAIN

2017-06-01 Thread Marcel Timmerman
On 06/01/2017 03:03 PM, H.Merijn Brand wrote: On Thu, 1 Jun 2017 14:11:47 +0200, Timo Paulssen wrote: It seems like this only works if you supply --dirs= multiple times perl6 -e 'sub MAIN (List :$dirs=[]) { .say for @$dirs }' --dirs=d1 --dirs=d2 --dirs=d3 d1

Re: list named argument in MAIN

2017-06-01 Thread H.Merijn Brand
On Thu, 1 Jun 2017 14:11:47 +0200, Timo Paulssen wrote: > It seems like this only works if you supply --dirs= multiple times > > perl6 -e 'sub MAIN (List :$dirs=[]) { .say for @$dirs }' --dirs=d1 > --dirs=d2 --dirs=d3 > > d1 > d2 > d3 took me a bit as it

Re: list named argument in MAIN

2017-06-01 Thread Marcel Timmerman
On 06/01/2017 02:11 PM, Timo Paulssen wrote: It seems like this only works if you supply --dirs= multiple times perl6 -e 'sub MAIN (List :$dirs=[]) { .say for @$dirs }' --dirs=d1 --dirs=d2 --dirs=d3 d1 d2 d3 HTH - Timo Thanks Timo, Just tested this and it works. But

Re: list named argument in MAIN

2017-06-01 Thread Timo Paulssen
It seems like this only works if you supply --dirs= multiple times perl6 -e 'sub MAIN (List :$dirs=[]) { .say for @$dirs }' --dirs=d1 --dirs=d2 --dirs=d3 d1 d2 d3 HTH - Timo

list named argument in MAIN

2017-06-01 Thread Marcel Timmerman
Hi, How can I read a list of items from the command line. Something like; mkdir.pl6 --dirs=d1,d2,d3 I thought I could do something like; sub MAIN (List :$dirs=[]) { mkdir($_) for @$dirs; } But it keeps displaying the usage message Greetings, Marcel