The special variable known as $0 works as desired when it is inside a script (eg, 'fooScript.pl'). However, when the happy camper retrofits his script code into a perl module (eg 'fooModule.pm'), the happy camper becomes sad. Why? Because $0 doesn't report the name of the *module*, it reports the name of the *calling script* (eg 'fooScriptThatHappensToUseFooModulePM.pl) .
The happy camper doesn't have a complaint with the way $0 works, that's sensible enough, but is there an alternative to $0? The happy camper wishes for a special variable that reports the name of the *perl module file* in which it is located. Is there such a thing?
In reply to Searching for an alternative to $0 by dimar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |