Re: declarations within an if statement.

2001-12-19 Thread Michael R. Wolf
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

RE: declarations within an if statement.

2001-12-19 Thread Bob Showalter
> -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

Re: declarations within an if statement.

2001-12-19 Thread Jenda Krynicky
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

Re: declarations within an if statement.

2001-12-19 Thread Curtis Poe
--- 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

declarations within an if statement.

2001-12-19 Thread Ben Curran
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