in reply to Searching one array with elements from another (was: ehh!)

Since you want exact substring matches, index() will work, as the previous comment said. However, since it appears that the substrings to be found always occur at the beginning, another way you could go is with substr. I.e.     if ( substr( $_, 0, length($h) ) eq $h ) Putting that into a grep, you'd get something like this:
# we put this in a sub so we can short-circuit via return. # pass headers to search for; # analyzes $_ sub matches_a_header { for my $h ( @_ ) { substr( $_, 0, length($h) ) eq $h and return 1; } 0 } my @matching_records = grep { matches_a_header( @headers_to_find ) } @records;

jdporter
...porque es dificil estar guapo y blanco.