If you are using require with a physical path to the module file you already know the path. If you are concerned with absolute path rather than relative one you can use getcwd() prepended to the relative path mentioned in the require statement.
If you will use the module rather than requireing it you will find absolute path of module file into %INC hash variable with key as the module name.
use lib '/www/somedir/' use test; print $INC{test};
In reply to Re: current path in a package?
by samarzone
in thread current path in a package?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |