reeddeer wrote :
> Using XP, SP2, all my previously working perl scripts now fail to
> notice any of the commandline arguments. I've never heard of this
> happening. I've rebooted the box and removed, then reinstalled
> ActivePerl-5.8.1.807-MSWin32-x86.msi, tested again and rebooted again.
> I've wondered if SYSIN could be mis-directed? Batch files accept
> arguments readily.
>
> Here is a testarg.pl program which fails to detect any arguments:
>
> [snipped]
look at this, I hope it helps:
shell > perl -e 'if($#ARGV > -1) { print $#ARGV +1," arguments were passed\n"}
else { print "no arguments were passed\n"}' hello world
2 arguments were passed
shell > perl -e 'if($#ARGV > -1) { print $#ARGV +1," arguments were passed\n"}
else { print "no arguments were passed\n"}'
no arguments were passed
The index of the last argument is in $#ARGV, so $#ARGV +1 returns the
number of arguments
Best regards
Martin
--
perl -e '$S=[[73,116,114,115,31,96],[108,109,114,102,99,112],
[29,77,98,111,105,29],[100,93,95,103,97,110]];
for(0..3){for$s(0..5){print(chr($S->[$_]->[$s]+$_+1))}}'
|