in reply to Re: Poll: Is your $^X an absolute path? (argv[0])
in thread Poll: Is your $^X an absolute path?
Win32 Perl has always had GetModulePathName()
At least my cursory grep didn't find that function in the perl source -- but perhaps it's called via some libraries or alias. It looks like it's just getting the name from whatever the compiler sets up as argv[0].
Based on 'case 3' in this article, I thought it might be possible to spoof the executable name with a bogus argv[0] via CreateProcess, but my experiments with Win32::Process and Win32::Job weren't successful at getting anything other than the absolute path. I didn't try with Win32::API directly as that doesn't (yet) compile for Vanilla Perl.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Poll: Is your $^X an absolute path? (argv[0])
by tye (Sage) on Aug 18, 2006 at 05:13 UTC | |
by xdg (Monsignor) on Aug 18, 2006 at 11:57 UTC | |
by tye (Sage) on Aug 18, 2006 at 12:19 UTC | |
by xdg (Monsignor) on Aug 18, 2006 at 13:55 UTC | |
by tye (Sage) on Aug 18, 2006 at 14:27 UTC | |
|