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;
    

3 Comments

Leave a comment

About Walter Vargas

user-pic I Blog About Perl