Suppose I have 2 files in a directory
p.pl
Mod.pm
In perl5 I can load a module Mod.pm from p.pl via:
use FindBin qw($Bin);
use lib "$Bin";
...
use Mod;
I wonder what the Raku
equivalent would be (if files are p.raku and Mod.rakumod)?
What I want to accomplish is to load a module relative to a script.
cd d0; rakudo d1/p.raku
as well as cd d1; rakudo p.raku
As ValleLukas explained:
use lib $*PROGRAM.dirname
use Mod;
can be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With