in reply to speedy way to compare elements in pairs of arrays?

It's hard to tell from your "code" but it looks like you have multiple sets (the elsif part) of criteria and are looping over the complete pair of arrays, checking for each criterium. This is of course straightforward. The only room for optimization probably is in "the first index position where a simple set of criteria are met". The idea is to short-circuit the loop as fast as possible. Two possibilities come to (my) mind:
  1. for each pair of arrays, loop over the criteria and then over the data, returning as early as possible. if the data that is to be found is likely to be early in the array this might save time.
  2. put your criteria sets in an array of subroutines. when you loop over the data arrays and one of the subs returns true, remove it from the list. That way it won't get executed uneccessarily. (Like truncating your if/elsif tree). Once the critera array is empty you can leave the loop completely. The subroutine calls may outweigh that though.


holli

When you're up to your ass in alligators, it's difficult to remember that your original purpose was to drain the swamp.