the important part here is the list context.
As usual, retrospect is 20/20, and now I see it. However, it's easy to see how one can be confused in the first place.
for my $line (<FILE>)
sure looks like scalar context, because $line isn't an array. This is further underscored by the fact that the loop will assign the next "line" to the variable. Because it feels like <FILE> is being read line-by-line, it's easy to see how for is treating <FILE> like a one-item array upon each iteration. Cap it all off with Duff's comment that perl 6 will "do the right thing" by... well, doing what I just described.
So, which is the right(tm) way? The @array context that it's currently doing (that you described)? Or the line-at-a-time way that I described, and that will be part of perl6?
I can see it both ways now, which is why I think the biggest problem is that this very thing isn't spelled out more explicitly in the perl book.
In reply to Re^4: nested <FILE> read returns undefined?
by argv
in thread nested <FILE> read returns undefined?
by argv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |