# The suffix +/- correspond to "matching" and "non-matching" input, # respectively. # input length: 7 Rate ?## use strict; use warnings; use Benchmark 'cmpthese'; my $sz = ( shift || 10 ) - 4; our $match = 'N' . 'x' x $sz . '001'; our $nomatch = 'N' . 'x' x $sz . '000'; print '# input length: ', length( $match ), $/; cmpthese( -1, { '?!+' => '$::match =~ /^N(?!.*00$).*$/', '?!-' => '$::nomatch =~ /^N(?!.*00$).*$/', '? '$::match =~ /^N.*(? '$::nomatch =~ /^N.*(?