Sometimes one has to store a file handle in a hash:
open( FH, ">test.log"); $h{ fh} = \*FH; print { $h{ fh}} "some output\n"; close( $h{ fh});
Notice the strange syntax: print needs a {$h{ fh}}, whereas close wants a $h{ fh}.
{$h{ fh}}
$h{ fh}