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

Re: Reading 2 array lists

Thread Previous | Thread Next
From:
Gunnar Hjalmarsson
Date:
February 18, 2009 17:02
Subject:
Re: Reading 2 array lists
Message ID:
20090219010153.11963.qmail@lists.develooper.com
Chas. Owens wrote:
> On Wed, Feb 18, 2009 at 15:43, mritorto <mritorto@gmail.com> wrote:
>> 
>> #compares directories on 2 servers
>> open (INPUT, "<atlasdirectorylisting.txt");
>> open (INPUT2, "<ISISdirectorylisting.txt");

<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.

> 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.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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