sub path_to_op { my ($node,$tgt,$path)=@_; $path||=''; return $path if $node==$tgt; foreach my $key (keys %$node) { my $path=path_to_op($node->{$key},$tgt,"$path{$key}"); return $path if $path; } return '' }