I suspect I'm missing something, though.@array1[2] = @array2[2] = 'hi'; if ($array2[2] eq $array1[2] ) { print $array2[2]; print "\n"; } # prints this: hi
Could you post your arrays, too? I think a little more detail is needed.
Remember that 'eq' is for strings, and '==' is for numbers.
In reply to Re: comparing elements of two arrays
by mrbbking
in thread comparing elements of two arrays
by luke123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |