#!/usr/bin/perl use strict; use IO::File; # though you don't have to in 5.8, of course my %fh_hash; for ( qw/foo bar baz/ ) { $fh_hash{$_} = new IO::File; $fh_hash{$_}->open( "> $_.txt" ) or die "$_.txt: caramba: $!"; # the next line, if uncommented, will produce a syntax error: # print $fh_hash{$_} "testing output to $_\n"; # but doing it this way is okay, and it works: print {$fh_hash{$_}} "testing output to $_\n"; }