use Symbol qw/gensym/; my $foo = gensym; *$foo->{bar} = 'quz'; dd \%Symbol::GEN0; # { bar => "quz" }