Parse command-line arguments
sub MAIN (Bool :$b, Str :$s = '', Int :$n = 0, *@rest) {
say "Bool: $b";
say "Str: $s";
say "Num: $n";
say "Rest: @rest[]";
}Output:
$ ./main -h
Usage:
./main [-b] [-s=<Str>] [-n=<Int>] [<rest> ...]
$ ./main -b -n=42 -s=turtles all the way down
Bool: True
Str: turtles
Num: 42
Rest: all the way downLast updated