develooper Front page | perl.beginners | Postings from February 2009

Re: How to speed up two arrays compare.

Thread Previous | Thread Next
From:
Telemachus
Date:
February 11, 2009 05:06
Subject:
Re: How to speed up two arrays compare.
Message ID:
20090211130636.GA91904@ilium.local
On Wed Feb 11 2009 @  4:04, kevin liu wrote:
> Hi everybody:
> 
>         I have two arrays(@nwarray0 and @nwarray1) in my program and i want
> to make sure that all the elements in @nwarray0 could be found in @nwarray1.

Check 'perldoc -q array' - two or three of the FAQ answers touch on
different ways to compare arrays, test them for equality, etc. As Raymond
said, the basic answer seems to be "Use a hash," but there are lots of good
examples to play with.

HTH, T

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About