in reply to file processing, while and foreach: a n00b experience

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
my @x = <FH>; foreach (@x) { ... }
And this code does slurp the whole file into memory first.

daniel.