Thus it was written in the epistle of Bart Lateur,
> On 7 Aug 2000 16:06:44 -0000, Perl6 RFC Librarian wrote:
> 
> >This RFC contains two proposed changes.  First, as it is common to want to 
> >removed newlines upon reading a file, 
> >
> >  while (chomp(<FILEHANDLE>)) {
> >    . . .
> >  }
> >
> >should become the equivalent of
> >
> >  while (<FILEHANDLE>) {
> >    chomp;
> >    . . .
> >  }
> 
> ...
> 
> >C<chomp()> called in a scalar context would leave its argument variable
> >untouched and instead return a C<chomp()>ed version of that variable's
> >contents.
> 
> These two contradict each other. If the latter is realized, the while
> loop of the former ought to be exited at the first empty line, or where
> it contains just a zero (and an optional newline).

I guess that's not yet clear to me.  After all, as I had pointed out to me,

while(<FILE>) 

means

while (defined($_ = <FILE>))

not 

while ($_ = <FILE>)

even if the chomp() is handed an empty line, it will return a defined value.
Only at the point at which <FILE> returns undef will the while cease.

Ted
-- 
Ted Ashton ([EMAIL PROTECTED]), Info Sys, Southern Adventist University
          ==========================================================           
How can it be that mathematics, being after all a product of human thought
independent of experience, is so admirably adapted to the objects of
reality?
                                        -- Einstein, Albert (1879-1955)
          ==========================================================           
         Deep thoughts to be found at http://www.southern.edu/~ashted

Reply via email to