3 ms·
$runpath might be safe now, but it doesn't have to be forever. It could come from a config file one day. I'm not sure why using a lexical variable to store a f
by phaylon 16y ago
$runpath might be safe now, but it doesn't have to be forever. It could come from a config file one day.
I'm not sure why using a lexical variable to store a filehandle you only need lexically is more fancy than storing it in a globally accessable package typeglob for anyone to use and modify. But it does give you the advantage that your garbage collector will close your file handles instead of you having to do it manually. If I see close($fh) in my own code, I know I had a reason other than "I didn't need it anymore."