Skip to content

Instantly share code, notes, and snippets.

@treyharris
Created June 21, 2019 21:33
Show Gist options
  • Save treyharris/d6660bfe85ef83282c2a8c47dc277ae2 to your computer and use it in GitHub Desktop.
Save treyharris/d6660bfe85ef83282c2a8c47dc277ae2 to your computer and use it in GitHub Desktop.
#!/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