C
Clint O
Even though Perl offers the exec { path } @args call, I notice it drops thefirst parameter in @args: It's not captured in $0 nor is it available in @ARGV. Is this value available anywhere? I also checked $^X, but this usually is the interpreter at the top of the Perl script (#!/path/to/interpreter).
Thanks,
-Clint
% cat /tmp/foo
#!/home/utils/perl-5.10/5.10.1-nothreads-64/bin/perl
exec { "$ARGV[0]" } @ARGV[1..$#ARGV];
print "$!\n";
% cat /tmp/args.c
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("I am %s\n", argv[0]);
return 0;
}
% cat /tmp/args.pl
% cat /tmp/args.pl
#!/home/utils/perl-5.10/5.10.1-nothreads-64/bin/perl
use strict;
use warnings;
print "I am $0 ", @ARGV ? @ARGV : "", "\n";
% /tmp/foo /tmp/args hoohah boohah
I am hoohah
% /tmp/foo /tmp/args.pl hoohah boohah
I am /tmp/args.pl boohah
So, in the Perl case, I’m missing “hoohah”…
-Clint
Thanks,
-Clint
% cat /tmp/foo
#!/home/utils/perl-5.10/5.10.1-nothreads-64/bin/perl
exec { "$ARGV[0]" } @ARGV[1..$#ARGV];
print "$!\n";
% cat /tmp/args.c
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("I am %s\n", argv[0]);
return 0;
}
% cat /tmp/args.pl
% cat /tmp/args.pl
#!/home/utils/perl-5.10/5.10.1-nothreads-64/bin/perl
use strict;
use warnings;
print "I am $0 ", @ARGV ? @ARGV : "", "\n";
% /tmp/foo /tmp/args hoohah boohah
I am hoohah
% /tmp/foo /tmp/args.pl hoohah boohah
I am /tmp/args.pl boohah
So, in the Perl case, I’m missing “hoohah”…
-Clint