Trying to alter the value of $testfile depending on how many arguments are
given, using the following:

if (@ARGV == 2) {
chdir $ARGV[0];
my $testfile = $ARGV[1];
}
else {
my $testfile = $ARGV[0];
}


I figured out what was wrong, i.e. I can't use my $testfile within the if,
giving me :

my $testfile;
if (@ARGV == 2) {
chdir $ARGV[0];
$testfile = $ARGV[1];
}
else {
$testfile = $ARGV[0];
}

which works. 

Why though? Isn't the first complitation run through the script by the
interpreter, a syntax check? why would it pick up my $tesfile twice?


cheers.
ben.


This e-mail, and any attachment, is confidential. If you have received
it in error, please delete it from your system, do not use or disclose
the information in any way, and notify me immediately. The contents of
this message may contain personal views which are not the views of the
BBC, unless specifically stated.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to