Shawn H Corey wrote:
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> )){
That is not "evil" but it won't work correctly if $/ is not found at the
end of $line or $/ does not contain a string.
John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity. -- Damian Conway
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/