Parse command-line arguments: Difference between revisions

m
→‎{{header|Raku}}: Fix comment: Perl 6 --> Raku
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
m (→‎{{header|Raku}}: Fix comment: Perl 6 --> Raku)
Line 705:
=={{header|Raku}}==
(formerly Perl 6)
At the end of running any top-level code (which can preprocess the arguments if it likes), Perl 6Raku automatically examines any remaining arguments and transforms them into a call to a <tt>MAIN</tt> routine, if one is defined. The arguments are parsed based on the signature of the routine, so that options are mapped to named arguments.
<lang perl6>sub MAIN (Bool :$b, Str :$s = '', Int :$n = 0, *@rest) {
say "Bool: $b";
2,392

edits