In my perspective Perl syntax for grep doesn't help making it faster when searching for exact values. Let me explain. While it is not that common, what you do when trying to grep for an exact string from an array?

Perl makes the use of pattern matching on greps easy:

@selected = grep { /^foo$/ } @list;

You can argue on the usability. But trust me, every once and then, some strange constructs get really useful. Unfortunately the above expression is not efficient. If you replace it by

@selected = grep { $_ eq "foo" } @list;

you get a two times faster code (check the bottom for Benchmark results).

Following the idea of split that accepts a string and uses it for the split process, I think grep could accept a string as well (at least on grep EXPR,LIST construct):

@selected = grep "foo", @list;

What kind of inconveniences would this raise?

Benchmark: timing 50000 iterations of equal, match...

equal: 22 wallclock secs (21.25 usr + 0.14 sys = 21.39 CPU) @ 2337.54/s (n=50000)

match: 53 wallclock secs (51.50 usr + 0.29 sys = 51.79 CPU) @ 965.44/s (n=50000)

