in reply to current path in a package?
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};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: current path in a package?
by ELISHEVA (Prior) on Dec 28, 2010 at 08:34 UTC |