Last active
October 7, 2015 22:52
-
-
Save donaldh/82a9ab17466e22f8ff12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% ./hello.p6 | |
Usage: | |
./hello.p6 [--language=<str>] <name> | |
% ./hello.p6 --language=french Donald | |
Bonjour Donald! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
sub MAIN($name, str :$language = 'english') { | |
given $language { | |
when 'english' { | |
say "Hello {$name}!" | |
} | |
when 'french' { | |
say "Bonjour {$name}!" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment