#!/usr/bin/perl -- use Benchmark qw/ cmpthese /; print "$]\n"; my $what1 = 'WWWA'; my $what2 = $what1; cmpthese( -3, { circumcised => sub { $what1 =~ /EB.*Z/; # fail one $what1 .='DBBBABC'; substr $what1, 0, 8, ''; $what1 =~ /EB.*Z/; # fail another return; }, uncut => sub { $what2 =~ /EB.*Z/; # fail one $what2 .='DBBBABC'; $what2 =~ /EB.*Z/; # fail another return; }, }, ); print "\n\n"; __END__ 5.010001 Rate uncut circumcised uncut 2735/s -- -100% circumcised 3398892/s 124179% --