OK, this does the comparison in a single line, using no modules and no explicit loops:
my $match = @array1 == @array2 && !grep { !$_ } map { $array1[$_] eq $ +array2[$_] } 0 .. $#array1;
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^3: any replacements for smartmatch on comparing two arrays
by Athanasius
in thread any replacements for smartmatch on comparing two arrays
by ramachandrajr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |