#!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"; }