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; }
In reply to Re: compare two reference in perlway
by mr_ron
in thread compare two reference in perlway
by k_manimuthu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |