A
Alan Barclay
Using perl5.005 this script outputs 'zero'
#!/usr/bin/perl
exec {'/usr/bin/perl'} ('zero','-e','print $^X,"\n"');
Using 5.8.0 the same script gives /usr/bin/perl - the actual path of
perl.
Perlvar says
$^X The name used to execute the current copy of Perl, from
C's
"argv[0]".
But this isn't argv[0], because I forced argv[0] to be zero in my
script.
This is obviously a behaviour change somewhere between 5.005 and
5.8.0, and I can see how in some ways that 5.8.0 behaviour is more
useful, but there is definatly a conflict between the documented
behaviour and the actual behaviour. Which one is right?
#!/usr/bin/perl
exec {'/usr/bin/perl'} ('zero','-e','print $^X,"\n"');
Using 5.8.0 the same script gives /usr/bin/perl - the actual path of
perl.
Perlvar says
$^X The name used to execute the current copy of Perl, from
C's
"argv[0]".
But this isn't argv[0], because I forced argv[0] to be zero in my
script.
This is obviously a behaviour change somewhere between 5.005 and
5.8.0, and I can see how in some ways that 5.8.0 behaviour is more
useful, but there is definatly a conflict between the documented
behaviour and the actual behaviour. Which one is right?