[oak perl] Comparing two files

M. Lewis cajun at cajuninc.com
Sun May 29 20:33:44 PDT 2005


Thanks Jim. get_unique() was exactly what I needed.

Thanks for calling my attention to your module.

M


M. Lewis wrote:
> Thanks Jim. I'll check out the module.
> 
> Thanks,
> Mike
> 
> 
> James Keenan wrote:
> 
>>>From: "M. Lewis" <cajun at cajuninc.com>
>>>
>>>I'm writing a script to compare two text files ($shortfile & 
>>>$longfile).
>>>If a line appears in $shortfile, but that line is not in $longfile, 
>>>then
>>>I want to write that line out to $differences
>>>
>>>I'm relatively certain it is not efficient to open $longfile for each
>>>entry in $shortfile. Both files are of the magnitude of 800+ lines.
>>
>>
>>As Michael Paoli and Mark Bole have noted these files are small enough 
>>that you can slurp them into memory and deal with them as arrays or 
>>hashes.
>>
>>My List-Compare module, available on CPAN, has methods such as 
>>get_unique() and get_difference() which might be useful in this 
>>respect.  It can handle either arrays or hashes as arguments.
>>
>>Jim Keenan
>>
>>_______________________________________________
>>Oakland mailing list
>>Oakland at pm.org
>>http://mail.pm.org/mailman/listinfo/oakland
>>
> 
> 

-- 

  Performance proven: It works through beta test.
  22:32:01 up 4 days,  4:49,  6 users,  load average: 0.16, 0.04, 0.01

  Linux Registered User #241685  http://counter.li.org


More information about the Oakland mailing list