On Wed, Feb 17, 2010 at 08:44:57AM -0800, macke...@animalhead.com wrote: > $^X is simpler, and simpler solutions are preferable. > Can it be wrong?
Yes. For starters, it may be a relative path, and the program has already changed directory. As $^X originates from argv[0] in main(), it's also possible (but unusual) for the program invoking your program to call exec() such that argv[0] isn't the actual path to the interpreter. Some hateful operating systems (IIRC, HP/UX, I'm looking at you), when invoking an interpreter after finding a #! line at the top of a script, do this, setting argv[0] to (also) be the script's name, with nothing passed in to give the actual name of the interpreter. Nicholas Clark