$ perl -MBenchmark=cmpthese -ne'chomp; $allwords.="/$_"; END{ cmpthese(-3, { "Greedy"=>sub { $allwords=~m{/abbreviate.+/initial/}; }, "Nongreedy"=>sub { $allwords=~m{/abbreviate.+?/initial/}; } } ); }' /usr/dict/words