... unless ( exists $abc{$parent}{$child} ) { my %c : shared; $abc{$parent}{$child}=\%c; } ...