in reply to What happens when I use a filehandle

One reason I like to use lexical filehandles is that they get automatically closed as soon as they go out of scope. So just remember to open your filehandle in the smallest scope that you need it in, and it will be garbage-collected and closed at the end of that block. (Unless you accidentally make a closure over it. I did that once. Oops.)
  • Comment on Re: What happens when I use a filehandle