Perl Calltrace
How to get the abs path of the script that do use modulename
?
- In the module:
1 package foo; 2 use common::sense; 3 use Cwd 'abspath'; 4 5 sub program { 6 say abspath($0); 7 } 8 9 1;
use modulename
?1 package foo; 2 use common::sense; 3 use Cwd 'abspath'; 4 5 sub program { 6 say abspath($0); 7 } 8 9 1;
short answer: http://search.cpan.org/perldoc?FindBin
Thanks
Or Dir::Self
Or lib::abs http://search.cpan.org/perldoc?lib::abs