Hi all,
Does anyone know how to find the directory path of the script that's being run? This is assuming that the script is being called somewhere other than where it is located, i.e. the script is in the path. Something similar to 'whereis' in *nix (I'd prefer not to make any system calls-- I want this to be portable to W32).
eg:
script location: /users/aneusomy/test.pl
current directory: /
I want when I run test.pl from / , the program to report:
/users/aneusomy/
I thought this may be in the %ENV but no luck, and I can't find any built-in perl functions that do this. The cwd() function only reports, as expected, the current working directory.
Any help is appreciated! (heh - this is not an April Fool's joke
)
Ben
Does anyone know how to find the directory path of the script that's being run? This is assuming that the script is being called somewhere other than where it is located, i.e. the script is in the path. Something similar to 'whereis' in *nix (I'd prefer not to make any system calls-- I want this to be portable to W32).
eg:
script location: /users/aneusomy/test.pl
current directory: /
I want when I run test.pl from / , the program to report:
/users/aneusomy/
I thought this may be in the %ENV but no luck, and I can't find any built-in perl functions that do this. The cwd() function only reports, as expected, the current working directory.
Any help is appreciated! (heh - this is not an April Fool's joke
Ben