in reply to foreach on array
I don't understand why you split on new lines here:
while (<APPLIST>) { push @inpfile, [split /\n/]; }
The way you read the file in, you only get one line at a time anyway. Instead of a while loop, you should be able to just do
@inpfile = <APPLIST>;
Later, you do this
local $/; open SLURP, $ifile or die "can't open $ifile: $!"; @filedata = <SLURP>; close SLURP or die "cannot close $ifile: $!";
After you undefined $/, <SLURP> will give you a scalar, so it doesn't seem to make sense to assign it to an array.
Either drop the local $/, or write $whole_filedata = <SLURP>.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: foreach on array
by tirwhan (Abbot) on Oct 13, 2005 at 09:18 UTC | |
|
Re^2: foreach on array
by revdiablo (Prior) on Oct 13, 2005 at 14:38 UTC | |
|
Re^2: foreach on array
by Anonymous Monk on Oct 13, 2005 at 08:36 UTC |