Skip to content

Instantly share code, notes, and snippets.

@rakudo
Created September 11, 2009 16:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rakudo/185407 to your computer and use it in GitHub Desktop.
Save rakudo/185407 to your computer and use it in GitHub Desktop.
$ cat main.p6
multi sub MAIN ($mode where 'css') { say "You're in the CSS option"; }
multi sub MAIN () { say "You didn't enter an option"; }
multi sub MAIN ($mode, $arg) { say "You entered two command line arguments"; }
multi sub MAIN ($mode) { say "Unknown mode $mode"; }
$ ./perl6 main.p6
You didn't enter an option
$ ./perl6 main.p6 foobar
Unknown mode foobar
$ ./perl6 main.p6 bar baz
You entered two command line arguments
$ ./perl6 main.p6 css
You're in the CSS option
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment