tomazos has asked for the wisdom of the Perl Monks concerning the following question:
How can you get a handle on the directory that a module is located in from within that module's code?
Lets say you have to write a module called Module.pm and you don't know where it will be installed, or which scripts it will be used by, but you know that in the modules parent directory there are some (grep "../*.foo") files you want to process.
Trouble is that grep is going to be relative to the current directory which is not necessarily the modules directory. To go relative to the module you need to be able to find out where it is.
Is that possible?
-Andrew.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Directory of PM file
by sh1tn (Priest) on Oct 12, 2005 at 09:22 UTC | |
Re: Directory of PM file
by bart (Canon) on Oct 12, 2005 at 10:20 UTC | |
Re: Directory of PM file
by EvanCarroll (Chaplain) on Oct 12, 2005 at 08:57 UTC |
Back to
Seekers of Perl Wisdom