Sprad has asked for the wisdom of the Perl Monks concerning the following question:

According to the Camel, filehandles will automatically close if they're re-open()ed. And I'd bet they also close when the program terminates. But do they ever close at any other time?

For instance, say I have this sub:

sub writefile { open (FILE, ">>myfile.txt"); print FILE "hello\n"; }
Will myfile.txt still be in use outside of writefile()?

A fair fight is a sign of poor planning.