in reply to comparing elements of two arrays
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) 2Re: comparing elements of two arrays
by jeffa (Bishop) on Dec 24, 2001 at 00:58 UTC | |
|
Re: Re: comparing elements of two arrays
by luke123 (Initiate) on Dec 25, 2001 at 00:51 UTC | |
by mrbbking (Hermit) on Dec 25, 2001 at 02:19 UTC |