luke123 has asked for the wisdom of the Perl Monks concerning the following question:
First I read 2 files and put them in 2 different arrays.
Then i want to compare elements of 2 arrays
This is my code for comparing array elements:
both of the elements of the 2 arrays are identical when I print them but the if statement evaluates to false anyaways? What is wrong with this statement?if ($array2[2] eq $array1[2] ) { print $array2[2]; print "\n"; }
Edit kudra, 2001-12-23 Added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: comparing elements of two arrays
by mrbbking (Hermit) on Dec 24, 2001 at 00:47 UTC | |
by jeffa (Bishop) on Dec 24, 2001 at 00:58 UTC | |
by luke123 (Initiate) on Dec 25, 2001 at 00:51 UTC | |
by mrbbking (Hermit) on Dec 25, 2001 at 02:19 UTC | |
|
Re: comparing elements of two arrays
by vek (Prior) on Dec 24, 2001 at 04:23 UTC | |
|
Re: comparing elements of two arrays
by andye (Curate) on Dec 24, 2001 at 01:00 UTC | |
|
Re: comparing elements of two arrays
by beernuts (Pilgrim) on Dec 27, 2001 at 21:36 UTC |