$hash{$w1}{$w2} = { total_counts => $tot_counts, words => { $nw => $count, } } #### @newarray = $hash{ $w1 }->{ $w2 }->{ words };