die "arrays different sizes" if $#array1 != $#array2; my $match = 1; # assume arrays match foreach (0..$#array1) { # unless otherwise $match = 0, last if $array1[$_] ne $array2[$_]; } if ($match) { # arrays match .... }
In reply to Re: comparing array elements
by Roger
in thread comparing array elements
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |