Phil Rhoades [2008-04-26 22:26]:
> I see what you are doing but this would have to be repeated for
> the three different lists (list1.txt, list2.txt, list3.txt)
well, yeah. but that's not really a problem, is it?

  %w[list1.txt list2.txt list3.txt].inject([]) { |matches, file|
    matches + File.open(file).select { |line|
      # ...same as before...
    }
  }

> I don't know if it helps but there is this:
> 
> http://www.koders.com/ruby/fidCEAEDCAA28D4A59A76ADF20A0DA2A3858438834D.aspx
=> http://amatch.rubyforge.org

silly me!! totally forgot about that one ;-) thanks for the reminder!

maybe i'll be able to come up with something that wraps flori's
Amatch into (Enumerable|File)#agrep.

> I was wondering about something like that but I have never
> created a Ruby binding before . .
neither have i. but that shouldn't stop us, right? ;-)

cheers
jens