#!/usr/bin/perl use strict; use warnings; use Benchmark qw/cmpthese :hireswallclock/; my @a = do { my @chr=(grep /\w/, map chr, 1..255); map { local $_ = join '', map $chr[rand @chr], 1..1000; tr/_/ / if .5 { Regex => sub () { grep !/_/, @a }, Index => sub () { grep index($_, '_') < 0, @a } }; __END__ #### C:\temp>perl index.pl Rate Index Regex Index 891/s -- -0% Regex 891/s 0% -- #### blazar@perlmonk ~ $ perl index.pl Rate Index Regex Index 261/s -- -0% Regex 262/s 0% --