Why do you need two for-loops? Wouldn't one work?
my @array1 = ('test', 'text', 'next'); my @array2 = ('text', 'test', 'next'); for (my $i=0; $i < scalar(@array1); $i++) { if ($array1[$i] eq $array2[$i]) { print "$array1[$i] matches\n"; } }
In reply to Re: Re: Re: comparing array elements
by Itatsumaki
in thread comparing array elements
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |