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


in reply to When do filehandles close?

Try for yourself (with the commented line commented and then uncommented):
#!perl -w use strict; $|=1; writefile(); print FILE "goodbye\n"; print `cat tmptmp`; sub writefile { # local *FILE; open (FILE, ">tmptmp") or die $!; print FILE "hello\n"; }