Created
November 11, 2019 10:23
-
-
Save Scimon/b589a25527b46e591e931287bcea8089 to your computer and use it in GitHub Desktop.
Simple Exmaple on plugins to MAIN sub
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
module Doubler { | |
sub doubler ( Cool() $x ) { $x *2 } | |
#| Doubles the given value | |
multi sub MAIN( "double", Cool() $x ) is export(:main) { | |
say "double( {$x} ) => {doubler($x)}"; | |
} | |
} |
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/perl6 | |
use v6; | |
use Doubler :main; | |
#| Various numeric operations | |
multi sub MAIN( Bool :h(:$help) where so * ) { | |
say $*USAGE; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment