Created
June 21, 2019 21:33
Star
You must be signed in to star a gist
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
| #!/usr/bin/env perl6 | |
| package My-Fourth-Modules-Script { | |
| proto MAIN($) is export { * } | |
| multi MAIN($x) { | |
| say "This is the inside MAIN called with $x"; | |
| } | |
| } | |
| multi sub MAIN($x) { | |
| say "This is the outer MAIN called with $x"; | |
| My-Second-Modules-Script::MAIN($x); | |
| } | |
| # $ ./My-Fourth-Modules-Script.pm6 | |
| # Usage: | |
| # ./My-Fourth-Modules-Script.pm6 <x> | |
| # $ ./My-Fourth-Modules-Script.pm6 32 | |
| # This is the outer MAIN called with 32 | |
| # Could not find symbol '&MAIN' | |
| # in sub MAIN at ./My-Fourth-Modules-Script.pm6 line 14 | |
| # in block <unit> at ./My-Fourth-Modules-Script.pm6 line 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment