in reply to Bulk Regex?

There are several things you can do for efficiency: not much for elegance.

  1. As you read each line from the file, study it.
  2. Apply qr// to each of @patterns.
  3. Do not combine @patterns into a larger pattern. Iterate instead
  4. Quit iterating at the first match.
  5. Keep score. Sort @patterns so that the commonest matches come first.

Not all these will help or may apply. For instance, a parser may have fixed priorities for matches, preventing use of #5. As for the others, Benchmark. Strategy #4 is observed by the big alternation, so should be used in any iterative scheme, too..

Update: Bah, underspecified. It sounds like you want an rdbms and DBI to store your data. RMGir's hash idea is good too.

After Compline,
Zaxo