Ben Curran <[EMAIL PROTECTED]> writes:
> 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];
> }
Help yourself and your readers out. U
> -Original Message-
> From: Ben Curran [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 19, 2001 10:54 AM
> To: [EMAIL PROTECTED]
> Subject: declarations within an if statement.
>
>
> Trying to alter the value of $testfile depending on how many
> argum
From: Ben Curran <[EMAIL PROTECTED]>
> 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 w
--- Ben Curran <[EMAIL PROTECTED]> wrote:
> 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];
> }
This is syntactically correct, but s
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 $testf