A plea to not close a filehandle because Perl will close it for you?
Actually, this is one thing I always advise people to do - use lexical filehandles in tight scopes, and let their scoping take care of closing. That's much cleaner and easier to maintain than package filehandles.
It's related to the distinction between in control flow GOTO-driven and structured programs: you don't have to figure out the temporal sequence of code to understand where a filehandle comes into play and when its lifecycle ends, all you need is to look at the spatial layout of the source.
Makeshifts last the longest.
In reply to Don't close filehandles (was: To Kill a Meme: while(defined($line = <>)) )
by Aristotle
in thread To Kill a Meme: while(defined($line = <>))
by sauoq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |