set($ref_to_hash,1,(a c b d)) # set($hoh,$val, @path): ... by ariels sub set { my $hoh = shift; my $val = shift; my $last = pop @_; $hoh = $hoh->{$_} for (@_); $hoh->{$last} = $val } #### #create first node $hr=\%I; $hr->{'one'}=1; #create tmp node and link back in $new=\%tmp; $new->{'two'}=1; $hr->{'one'}=$new;