It helps to know that
while (<FH>) {
is equivalent to
while (defined($_ = readline *FH)) {
and that
foreach (LIST) flattens the list it gets. (Well, there are some special cases like
foreach (ARRAY) and
foreach (RANGE) that are more efficient.)
See the documentation on readline to find out how it behaves differently when used in list context.
In Perl 6, this will not be much of a problem, since it will have "lazy lists". A normal for (LIST) will do what you mean, in an efficient way.
Juerd
# { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }