[Israel.pm] The fastest way to compare arrays

Yossi.Itzkovich at ecitele.com Yossi.Itzkovich at ecitele.com
Sun May 14 23:44:49 PDT 2006


Hi,

Thanks Omer, but you treated it like a "project". For a project it's a good
approach.  But I need  much simpler solution (few lines of code or a
module).

Yossi


perl-bounces at perl.org.il wrote on 15/05/2006 09:41:32:

> On Mon, 2006-05-15 at 09:24 +0300, Yossi.Itzkovich at ecitele.com wrote:
> > Hi,
> >
> > I have two arrays of strings.
> >
> > 1. What's the fastest (writing,executing) way to compare the two
arrays,
> > and just to know if they differ (like unix' cmp)?
> > 2. Is there a way to get a nice (?) report about the differences
between
> > the two (like unix' diff) ?
>
> If I were asked to do this project, I'd approach it as follows:
> 1. Locate the source code of cmp and diff.
> 2. Refactor the code which actually performs the comparison/reporting
> into its own library.
> 3. Build a Perl binding for the library, using swig.
> 4. If necessary, profile and optimize the code to work optimally with
> the data, which you have.
>                                               --- Omer
> --
> Every good master plan involves building a time machine.  Moshe Zadka
> My own blog is at http://tddpirate.livejournal.com/
>
> My opinions, as expressed in this E-mail message, are mine alone.
> They do not represent the official policy of any organization with which
> I may be affiliated in any way.
> WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl




More information about the Perl mailing list