--- Larry Wall <[EMAIL PROTECTED]> wrote:
> On Thu, Mar 24, 2005 at 01:17:40PM +0800, Autrijus Tang wrote:
> : As of r1079, there is $?EXECUTABLE_NAME (that is, $^X in perl5) and
> : $?PROGRAM_NAME (that is, $0 in perl5).  Note that those two things
> : are unspecced -- I just pulled them out from perlvar.
> 
> I'd also note the $*EXECUTABLE_NAME might be different from
> $?EXECUTABLE_NAME.  In fact $*EXECUTABLE_NAME might not be known
> till run time, while $?EXECUTABLE_NAME is required to be known at
> compile time, as are pretty much all $? variables.

Thanks Autrijus. I'm sure you have higher priority tasks than this one
but before I forget, I better note that what is currently returned by
Pugs $?EXECUTABLE_NAME differs from p5 $^X.

Running 'perl test.pl', where test.pl is:

print "exe_name='$^X'\n";

produces, on Windows and Linux at least, the absolute path of the
perl executable, for example:

exe_name='C:\Perl\bin\perl.exe'
exe_name='/usr/bin/perl'

With Pugs however, running:

print "exe_name='$?EXECUTABLE_NAME'\n";

produces just the bald:

exe_name='pugs'

which is not useful when running pugs programs during make test.
I worked around this for now, by using "./pugs ..." for Unix and
"pugs ..." for Windows (where cwd comes first on PATH).

$^X is defined as "The name used to execute the current copy of Perl".
In addition to that, there is C's argv[0] (which may or may not match
$^X) and the file name of the perl/pugs executable (which may or may
not match $^X). Not that I have a use for the last two, but I don't
a way to get them from perl.

/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

Reply via email to