in reply to Re^3: How to determine the path to the Perl binary that executed your program?
in thread How to determine the path to the Perl binary that executed your program?

I'm probably misunderstanding you, but even if perl is invoked without explicit path info and is found through the path environment variable, $^X is still correctly set:

C:\test>perl -le" print $^X" C:\Perl\bin\perl.exe C:\test>..\perl\bin\perl -le" print $^X" C:\Perl\bin\perl.exe

The only way I know of getting a different value for the path in $^X is if it is invoked via a subst (or NET USE) drive:

C:\test>subst p: c:\perl\bin C:\test>p:perl -le" print $^X" P:\perl.exe

Even then, so long as the subst remains in force, $^X remains valid for all normal uses.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^5: How to determine the path to the Perl binary that executed your program?
by demerphq (Chancellor) on Sep 29, 2006 at 09:46 UTC

    Hrmmmm.... You know what. I plead lack of coffee. I'm thinking of $0. *blush*.

    ---
    $world=~s/war/peace/g