At 15:21 19.07.2001 +0200, Diego Riaņo wrote:
>Hi everybody
>
>I have two array, like this
>
>@array1=(one, two, three);
>@array2=(one,tww,three);
>
>Is there some way to compare the two arrays?
>I was trying with the eq and ne operations inside an IF statement but i
>does not work
>
>Could someone help me.
>
>
>Thanks
>
>Diego

This is a lot easier to do if you start out with a hash:

use strict;

my %hash1 = (one => 1, two => 1, three => 1);
my %hash2 = (one => 1, tww => 1, three => 1);
my @unique = grep{ !exists $hash2{$_} } keys %hash1;
print "$_\n" foreach (@unique);



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to