Hi,
I need to know the full path to the running script ( $0 provides the name of the file) is there a way to get the full path. for example:
I run the script "/root/eng/perlscripts/xyz.pl" $0 = xyz.pl
I need a way to know "/root/eng/perlscripts/xyz.pl"
I asked around and was yold that "FindBin" provides this sort of functionality. However, after reading the manual pages for it. It seems that it might not be the right way to go because of this comment in the manual:
"If there are two modules using FindBin from different directories under the same interpreter, this won't work. Since FindBin uses a BEGIN block, it'll be executed only once, and only the first caller will get it right. This is a problem under mod_perl and other persistent Perl environments, where you shouldn't use this module. Which also means that you should avoid using FindBin in modules that you plan to put on CPAN. To make sure that FindBin will work is to call the again function:"
Is there another way to do the same thing wich is more robust without these issues.
Thanks,
-shahriar