#!/usr/bin/perl use Benchmark 'timethese'; $short = "abcdefg"; $long = $short x 100; timethese(-5, { japhyS => q{ "$short=123" =~ /[^=]+=/ }, tyeS => q{ "$short=123" =~ /[^=]+?=/ }, japhyL => q{ "$long=123" =~ /[^=]+=/ }, tyeL => q{ "$long=123" =~ /[^=]+?=/ }, }); __END__ Benchmark: running japhyL, japhyS, tyeL, tyeS, each for at least 5 CPU seconds... japhyL: 5803.60/s (n=29018) tyeL: 1785.83/s (n=8947) japhyS: 30179.50/s (n=157537) tyeS: 26449.44/s (n=141240)