in reply to using a filehandle stored in a hash

Wrap the hash in a pair of braces:

my %hash; open $hash{fh}, '>', 'foo' or die $!; print {$hash{fh}} "foo"; # ^ ^


Unless I state otherwise, all my code runs with strict and warnings

Replies are listed 'Best First'.
Re^2: using a filehandle stored in a hash
by DavidFerrington (Acolyte) on Mar 28, 2010 at 11:18 UTC
    DOH!
    so simple - I didn't think of that - thank you
    -- David