Re: Reading X lines at a time

Rick Delaney <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
On Mon, May 03, 2004 at 03:27:01PM +0200, Georg Moritz wrote:
> From the keyboard of Rick Delaney [03.05.04,09:23]:
> 
> >     while (my @a = map { eof() ? () : scalar <> } 1 .. $n) {
> >         print @a;
> >         print "SEPARATOR\n";
> >     }
> 
> but this will loop forever, since the array @a is always defined, even
> on eof(). map() will return a bunch of undefs.

What makes you say that?

-- 
Rick Delaney
[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.