my %hoh; my $foo = "bar"; $hoh{$foo} = { "key1"=>"value1","key2"=>"value2" }; print $hoh{$foo}{"key1"}; print $hoh{bar}{"key1"}; # same thing