in reply to File handle as argument

It can be done with and without references.

Without references: use globs like this - foo(*FH). Then in "foo" you just use my $fh = shift; And $fh can be plugged in like a file-handle, in "print", for example.