K
Kevin Mooney
Walt said:I'm stumbling trying to find out if this is even possible with Perl.
Anyone know?
In a C program, it's possible to get the executable's name as argv[0]
-- a trick that's useful when you want one executable and a bunch of
symbolic links, but the program's behavior to change based on what it
was called. You'll note some crypto packages do this, as it is
simplier to have multiple man pages.
Since the Perl engine is the executable in reality, I figure the best
I'd get is the fully qualified path name of the running executable --
which might be useful if I have more than one version of Perl
installed.
Additionally, if I wanted a program to know about it's own source
file, it might be interesting to see what was passed to Perl. This is
_different_ than command line arguments being passed to a Perl script.
I'd like to know if the Perl engine itself exposes what was passed to
it.
Anyone know if there are some magic globals or environment variables
which contain either of these two pieces of information?
-Walt Stoneburner, (e-mail address removed)
For your first question, I believe $0 is what you are looking for.
Unfortunately I have no idea as far as your second question goes.