Reputation: 55
I have file .../module.pm and file .../somedir/program.pl How to export function from module.pm to program.pl? Or how to get path to current script?
Upvotes: 2
Views: 59
Reputation: 238296
You can use FindBin
to retrieve the path of the current script:
use FindBin; # locate this script
use lib "$FindBin::Bin/../module.pm"; # use the parent directory
use yourlib;
Upvotes: 3