Skip to content

Instantly share code, notes, and snippets.

@treyharris
Created June 21, 2019 21:55
Show Gist options
  • Save treyharris/78a2e0db94597ed592346570bec95c77 to your computer and use it in GitHub Desktop.
Save treyharris/78a2e0db94597ed592346570bec95c77 to your computer and use it in GitHub Desktop.
This is a unit package that works
#!/usr/bin/env perl6
unit package My-Fourth-Modules-Script;
our proto MAIN($) is export { * }
multi MAIN($x) {
say "This is the inside MAIN called with $x";
}
# No output:
# $ ./My-Fourth-Modules-Script.pm6
# $ ./My-Fourth-Modules-Script.pm6 242
# But, run correctly:
# $ perl6 -M My-Fourth-Modules-Script -e ' '
# Usage:
# -e '...' <x>
# $ perl6 -M My-Fourth-Modules-Script -e ' ' 32
# This is the inside MAIN called with 32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment