in reply to Re: multiple greps at once-- possible?
in thread multiple greps at once-- possible?

Hmm... It's intresting to combine the both approaches
my @a = qw (a d c d s f ss eef e as d); GREP: { grep{ $_ eq 'd' and next GREP } @a; print 'not match'; last GREP; } continue { print 'match'; last GREP; }
I'll benchmark this code later

Update: It' was a bad idea. This code is very slow. The two fastest are:

#... grep_line => sub { my($test, $ra) = @_; grep { $_ eq $t and return 1 } @$ra; return; }, for_line => sub { my($test, $ra) = @_; $test eq $_ and return 1 foreach @$ra return; } #...