in reply to compare two arrays
$ perl -le' use List::MoreUtils q=pairwise=; # corrected, see comment below my @a = ( 1, 2, 4, 5, 3 ); my @b = ( 1, 2, 4, 2, 3 ); my @c = pairwise { $a == $b ? 1 : 0 } @a, @b; print "@c"; ' 1 1 1 0 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: compare two arrays
by Anonymous Monk on Dec 15, 2008 at 04:59 UTC | |
by jwkrahn (Abbot) on Dec 15, 2008 at 09:39 UTC |