http://qs321.pair.com?node_id=674829


in reply to Why are lines being skipped in output?

By way of insight (or explanation): the while statement has some magic to do common tasks like this without stating everything specifically.
while (<FOO>) { ... }
seems to a newcomer like it would mean
while (not_the_end_of_the_file(*FOO)) { ... }
but in actuality it means
while (defined ($_ = readline(*FOO))) { ... }
So it does both tasks at once: breaks the loop at the end of the file, AND reads the next line into the default variable $_.

--
[ e d @ h a l l e y . c c ]