[Milan-pm] comparing 2 lists

Lally Blue lally22 at gmail.com
Tue Oct 6 03:36:05 PDT 2009


are the 2 arrays items in the same order?
in the reference it says:
"Internally the comparator compares the two arrays by using join to turn
both arrays into strings and comparing the strings using eq."
so I guess that if the first array has 1,2,3,4,5 and the second one
5,4,3,2,1 the Array::Compare returns false...
is this what you mean?

  -Ilaria-

On Tue, Oct 6, 2009 at 12:32 PM, Paola Bisignano
<paola.bisignano at gmail.com>wrote:

> Hi,
> I have two lists of numbers, saved in two files and I want to compare
> them, in order to check which are the same elements in both lists. I
> put them into array, so I want to compare array, but I only want to
> check the value, and It doesn't matter for the position in the array,
> I tried to use Array::Compare
>
>
>
> open (OUT, "> $file");
>                                        my $comp = Array::Compare-> new;
>                                        if ($comp->compare(\@array_num1,
> \@array_num2))
>                                                {
>                                                print "$comp\n";
>                                                print OUT "$comp\n";
>                                                }
>                                        close OUT;
>
> but it returns blank, I don't know why...
> _______________________________________________
> Milan-pm mailing list
> Milan-pm at pm.org
> http://mail.pm.org/mailman/listinfo/milan-pm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/milan-pm/attachments/20091006/c79802ba/attachment.html>


More information about the Milan-pm mailing list