As the others have said, lexical filehandles are closed automatically when they go out of scope. This does not apply to bareword filehandles such as open FILE, ..., these are essentially globals. Note that you can arrange to have other code executed at the end of the current lexical scope via the End module, although I haven't seen much code in the wild actually doing so.
In reply to Re: Automatically exiting a file within a block
by haukex
in thread Automatically exiting a file within a block
by betmatt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |