Dr.Ruud wrote:
> Jeff Peng wrote:
> 
>> so how about while (my $line = <FILE>) instead of using $_?
> 
> Evil! An empty line, or a line with only a "0" in it.
> 

Not quite.  Lines are not completely empty.  A blank line would have
"\n".  A line with just zero would have "0\n".  Only after a chomp would
the test fail.

WARNING:  Evil code, do not use:
  while( chomp( my $line = <FILE> )){


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

Eliminate software piracy:  use only FLOSS.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to