Reputation: 3194
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
Upvotes: 6
Views: 289
Reputation: 3194
As ValleLukas explained:
use lib $*PROGRAM.dirname
use Mod;
can be used.
Upvotes: 7