In Perl 5, I was able to set an option multiple times like in this question:
Perl Getopt Using Same Option Multiple Times
I am wondering if it's possible to do the same with Perl 6 and the MAIN sub ?
If you define your named parameters as an array then it just works :
perl6 -e 'sub MAIN( :@test ) { say @test }' --test=1 --test=2 --test=3
[1 2 3]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With