http://qs321.pair.com?node_id=193319


in reply to On timely destruction?

{ my $foo; open $foo, "<bar.txt"; print "Baz\n"; } { my $foo; open $foo, "<bar.txt"; print "xyzzy\n"; }
That's not an issue, because any new use of open should do a clean close, as if the variable has also gone out of scope.

-- Randal L. Schwartz, Perl hacker