http://www.perlmonks.org?node_id=1013406


in reply to filehandle for close

Try this:

use IO::File; my %files; $files{"foo"} = IO::File->new(">xyz"); print { $files{"foo"} } "done\n"; $files{"foo"}->close;