R
reeddeer
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:
use strict;
use warnings;
# -------------------------------------
# Main Program
# -------------------------------------
if(@ARGV > 0 )
{
print "1st arg: ~~$ARGV[0]~~ \n";
if ($#ARGV > 1 ) {
print "2nd arg: ~~$ARGV[1]~~ \n";
}
if ($#ARGV > 2 ) {
print "3rd arg: ~~$ARGV[2]~~ \n";
}
print "Done, read ~~$#ARGV~~ args.\n";
}
else
{
die "No arguments were seen! \n";
}
# -- end ------------------------------
I try it with:
testarg argue1 param2
and get: No arguments were seen!
testarg "argue1" "param2"
and get: No arguments were seen!
My co-workers have similar machines and they don't have the problem,
the same test script prints the arguments given.
Any suggestions? tips?
Thanks,
Reeddeer
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:
use strict;
use warnings;
# -------------------------------------
# Main Program
# -------------------------------------
if(@ARGV > 0 )
{
print "1st arg: ~~$ARGV[0]~~ \n";
if ($#ARGV > 1 ) {
print "2nd arg: ~~$ARGV[1]~~ \n";
}
if ($#ARGV > 2 ) {
print "3rd arg: ~~$ARGV[2]~~ \n";
}
print "Done, read ~~$#ARGV~~ args.\n";
}
else
{
die "No arguments were seen! \n";
}
# -- end ------------------------------
I try it with:
testarg argue1 param2
and get: No arguments were seen!
testarg "argue1" "param2"
and get: No arguments were seen!
My co-workers have similar machines and they don't have the problem,
the same test script prints the arguments given.
Any suggestions? tips?
Thanks,
Reeddeer