I'm creating my own module, lets call it X::Y
. Of course, the module will be in the file X/Y.pm
.
Lets say Y
needs to call an external program, prog
. Ideally I'd just like to put prog
in X
, so I can run X/prog
. I'd like to not have hardcode X/prog
s full path, and for the module to work regardless of the current working directory set.
How can I find the full path of a module from inside a module? Or is there a better way to do this?