my $tgs = shift; # scalar. my %hash = ( $tgs => 1 ); # sane-ish $hash{$tgs} = 1; # also sane-ish eval "my %Test_hash_$tgs = ()"; # why do this? die $@ if $@; # explode if it didn't work