Re: How to compare two arrays by using perl script?

2009-05-13 Thread milk
On Tue, May 12, 2009 at 11:05 AM, Tsu-Fan Cheng tfch...@gmail.com wrote:
 I have two arrays, each has two columns (so its A1, B1 and A2, B2). As
 are the positions while Bs are the values. I need to get the ratio
 between B1 and B2 if their As are the same or close to each other
 within a certain distance.

Well,
You can either compare it by hand or use a module. Use search.cpan.org
to find modules that might be useful. A search for 'Arrays' brought me
Set::Array which as the methods for at, length, intersection, and
union. You can use length and union to find out how many elements in
each array are different. If you want to know how 'close' each A is to
each other, you probably need to compare each element in each
manually.

-- 
milki
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


How to compare two arrays by using perl script?

2009-05-12 Thread Tsu-Fan Cheng
Hi ALL,
   This is not a fbsd-related but a programming question. But this is
the only forum I join, I give it a try.

I have two arrays, each has two columns (so its A1, B1 and A2, B2). As
are the positions while Bs are the values. I need to get the ratio
between B1 and B2 if their As are the same or close to each other
within a certain distance. This sounds pretty straight forward but I
am not an experienced programmer. Can anybody show me how to do it by
perl? thank you!!

TFC
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org