use Symbol qw/gensym/; my $fh = gensym; tie *$fh, ...;