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

Re: Reading 2 array lists

Thread Previous | Thread Next
From:
mritorto
Date:
February 22, 2009 23:36
Subject:
Re: Reading 2 array lists
Message ID:
86a5bbac-1698-4e3e-876d-30b3b2ee0f55@o40g2000prn.googlegroups.com
Owen,

I got it to work using your script and the list compare module

I figured that I had to copy the files to a certain directory .  The
directions cspan gave were wrong for windows

thanks

one question

what does this mean?

#####


my $comparison = List::Compare->new(\@atlas, \@isis);

print $comparison->get_symmetric_difference; ( the words from
$comparsion on ward)

#######

and are these certain modules
use warning
use strict

#####

Marc



On Feb 18, 8:33 pm, chas.ow...@gmail.com (Chas. Owens) wrote:
> On Wed, Feb 18, 2009 at 19:59, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> > Chas. Owens wrote:
> snip
> >> This is not the best way to go about solving this problem (use diff or a
> >> module like Text::Diff*),
>
> > If we are going to suggest a module, List::Compare would be more to the
> > point IMO.
>
> snip
>
> No, the lines should not make it out of the files into arrays in the
> first case.  Reading whole files into arrays is one of the reasons
> this code is bad.
>
> snip>> It is important to note that this algorithm only works if you care about
> >> unique lines. If you need to know that file1 has 5 lines of "foo" and file2
> >> has 4 lines of "foo", this code will not tell you that.
>
> > Since the files contain file names from directory listings, that cannot be
> > applicable to the problem at hand.
>
> snip
>
> Yes, but it is an important thing to note lest you try to use it for
> something else later.
>
> --
> Chas. Owens
> wonkden.net
> The most important skill a programmer can have is the ability to read.


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