in reply to compare two reference in perlway
Besides Data::Compare proposed by Eily, there are also Data::Walk and Data::Walker. When you put it together the problem seems to have a reasonably simple and neat solution:
use strict; use warnings; use Data::Walk; use Data::Compare; sub find_structure_part { my $search_space = shift; my $target = shift; my $found = 0; walk sub { if (not $found and Compare($_, $target)) { $found = 1 } }, $search_space; return $found; }
|
|---|