Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: file processing, while and foreach: a n00b experienceby wirrwarr (Monk) |
on Aug 27, 2003 at 12:20 UTC ( [id://287017]=note: print w/replies, xml ) | Need Help?? |
It should be emphasized that the argument
to foreach is evaluated in list context,
while the argument to while is evaluated in scalar context. This means that foreach (<FH>) is
(roughly) equivalent to
And this code does slurp the whole file into memory first. daniel.
In Section
Meditations
|
|