$0 is just the string on the command line that invoked the script - so again it would just point you to the original perl script's directory, not the module.
Whoops, I am using lib like you said - I mistyped it.
use lib $scriptingLib;
use MyOtherModule;
The problem is this module needs to be flexible in that a perl script from anywhere can call it and it can load it's other modules. So I would not like to rely on any knowledge about the...
Can you put all that into an eval block then check $@?
eval {
open (...);
open (...);
open (...);
}
die $@ if $@;
Not sure if that's correct, just an idea.
I'm trying to retrieve the full path of the current executing script or module. I am aware that $FindBin::Bin will return the path of the toplevel executing module, but that is different. getcwd() will get the current working directory, but again, that can be different.
The situation I'm using...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.