develooper Front page | perl.perl6.users | Postings from June 2017

list named argument in MAIN

Thread Next
From:
Marcel Timmerman
Date:
June 1, 2017 12:09
Subject:
list named argument in MAIN
Message ID:
1f3d666f-04c6-3537-b81a-2139fe9b1ac8@gmail.com
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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About