go ahead... be a heretic | |
PerlMonks |
while or foreach?by BBQ (Curate) |
on Dec 24, 1999 at 03:12 UTC ( [id://1363]=perlquestion: print w/replies, xml ) | Need Help?? |
BBQ has asked for the wisdom of the Perl Monks concerning the following question:
What's the difference between these two lines?
foreach $line (<FILE>) { print $line; } while ($line = <FILE>) { print $line; } Isn't it curious that they even have the same length? :o)
Back to
Seekers of Perl Wisdom
|
|