my %master; $master{$hashref->{y}}{$hashref->{z}} = 'value'; # In the spirit of giving 'em enough rope, # and hoping I never have to maintain the code, # here's the symbolic reference version ${$$hashref{y}}->{$$hashref{z}} = 'value';