in reply to any replacements for smartmatch on comparing two arrays
In addition to the previous suggestions including Laurent_R's suggestion of List::Compare, I've found that Data::Compare works quite well at this too:
perl -wMstrict -MData::Compare -E 'my @a=qw(1 2 a b); my @b=qw(1 2 a b +); say Compare(\@a, \@b);' 1 perl -wMstrict -MData::Compare -E 'my @a=qw(1 3 a b); my @b=qw(1 2 a b +); say Compare(\@a, \@b);' 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: any replacements for smartmatch on comparing two arrays
by ramachandrajr (Novice) on Sep 24, 2015 at 15:09 UTC | |
by CountZero (Bishop) on Sep 24, 2015 at 16:48 UTC | |
by stevieb (Canon) on Sep 24, 2015 at 17:08 UTC | |
by Athanasius (Archbishop) on Sep 24, 2015 at 15:57 UTC |