in reply to Quickly finding an element in an array

The fastest way to do this is almost certainly to use the first routine from the List::Util module. first works just like grep, except that it stops as soon as it finds an element that matches the condition. It's written in C, and very fast. This module (and its friend Scalar::Util) will be bundled with Perl 5.8, so get used to them now! :-)
  • Comment on Re: Quickly finding an element in an array