On Wed, Jan 19, 2005 at 10:54:53AM -0500, Dan Sugalski wrote:
"parrot". If, on the other hand, we were invoked as:
parrot foo.pbc
then both fullname and basename would be "parrot". Unix hashbang (and Windows file association) invocation may give us something different -- if the user did:
~/src/foo.pasm
and you'd either associated .pasm with parrot, or foo.pasm started "#! /usr/bin/parrot" (which is legal :) then you'd get a fullname of "~/src/foo.pasm" and a basename of "foo".
Clear and sensible?
Perl 5 makes the distinction between $^X (the interpreter name) and $0 (the script name)
Perl 5 also puts some effort into seeing if it can get a fully qualified path for the interpreter from the OS. Certainly this is do-able on Solaris, on Linux given /proc, and on FreeBSD given /proc and a following wind (at least on FreeBSD 4 where there is a bug). I think it's do-able on Win32 too.
Would we want to try to do this?
Good point--we should. That'd mean we'd want to have three sets of data: the invoked full/base name, the 'program' full/base name, and the interpreter full/base name. (With the invoked full/base being the same as either the program or interpreter full/base, but which way it went would depend on how things were fired off, so we might as well have them all separate)
--
Dan
--------------------------------------it's like this------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk