ScriptedMain.pm:
#!/usr/bin/env perl6
module ScriptedMain {
sub meaning_of_life is export {
return 42;
}
}
sub MAIN {
import ScriptedMain;
print "Main: The meaning of life is " ~ meaning_of_life() ~ "\n";
}
test.pl:
#!/usr/bin/env perl6
use lib '.';
use ScriptedMain;
print "Test: The meaning of life is " ~ meaning_of_life() ~ "\n";
$ ./ScriptedMain.pm
Main: The meaning of life is 42
# ^ correct
$ ./test.pl
Test: The meaning of life is 42
System:
$ specs perl6 os
Specs:
specs 0.14
https://github.com/mcandre/specs#readme
perl6 --version
This is perl6 version 2015.03 built on MoarVM version 2015.03
system_profiler SPSoftwareDataType | grep 'System Version'
System Version: OS X 10.10.2 (14C1514)