my $temp; $temp = $hash1->{'a'}->{'b'}->{'c'}; $hash2->{'bob'} = $temp if defined $temp;