M
MorningStar
I wrote a perl script and it will be called by other modules.
Now I need to know where I(my script) am when I am called.
For example: If my script located in:
/home/morningstar/a.pl
And some one called it from:
[home/someone]$ /home/morningstar/a.pl
or even
[home/someone]$ a.pl (if /home/morningstar is in $PATH ENV)
Then when a.pl was executed, how can it get its location:
"/home/morningstar/"?
If you don't understand what do I mean, just imagin the functionality
of 2 Windows API: GetModuleFileName and GetModuleFileNameEx.
Thanks.
Now I need to know where I(my script) am when I am called.
For example: If my script located in:
/home/morningstar/a.pl
And some one called it from:
[home/someone]$ /home/morningstar/a.pl
or even
[home/someone]$ a.pl (if /home/morningstar is in $PATH ENV)
Then when a.pl was executed, how can it get its location:
"/home/morningstar/"?
If you don't understand what do I mean, just imagin the functionality
of 2 Windows API: GetModuleFileName and GetModuleFileNameEx.
Thanks.