sub xyz { my ($tgs) = @_; my %Test_hash{$tgs} = {}; # use $Test_hash{$tgs}{foo}, etc. }