open(FILE ,">foo.txt");
&hoge(*FILE);

sub hoge{
local (*FILE) = shift;
print FILE "bar\n";
}

みたいかな?

あとはFileHandleつかうとか。
http://search.cpan.org/~abergman/ponie-2/perl/lib/FileHandle.pm