in reply to Passing an array to a subroutine
except your my $aref in the open is overriding the#open(FILE, my $aref); #or die "Cannot open: $file\n";
and you should be goldenopen(FILE, $aref) or die "Cannot open: $file\n"; $line = <FILE>;
<> works on @ARGV, not @_... if there is nothig it @ARGV it will read from STDIN
Update oh yes, the while loop would also use <FILE> instead of <>
- Ant
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Passing an array to a subroutine
by gisrob (Novice) on Jul 31, 2001 at 19:38 UTC | |
by suaveant (Parson) on Jul 31, 2001 at 21:04 UTC | |
by gisrob (Novice) on Jul 31, 2001 at 22:49 UTC | |
by chromatic (Archbishop) on Aug 01, 2001 at 00:06 UTC | |
by gisrob (Novice) on Aug 01, 2001 at 00:25 UTC |