more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Win32 Perl has always had GetModulePathName() which means that Perl on Win32 will always have an absolute path for $^X. I think that Linux now has similar functionality. However, other Unix platforms don't have a reliable way for an executable to figure out its filename. A Unix executable just gets argv[0] which can have absolutely nothing to do with the name of the executable. argv[0] will often be a path string that an algorithm like that used (perversely) by FindBin could be used to find the executable path. If you want to know what happens on those platforms, I'd look at Perl's source code rather than try to conduct a poll. Update: Here is the best way to prevent Perl from setting $^X to a real path: which will produce "notPerl" on most non-Linux Unix platforms (and probably even on Linux for not-the-latest releases of Perl) but will produce the full path to your Perl executable on Win32 (even Win95). - tye In reply to Re: Poll: Is your $^X an absolute path? (argv[0])
by tye
|
|