use Benchmark; my $mine = <<'ME'; my $stuff = < -1; my $stop_tag = shift; my $stop_pos = index $stuff, $stop_tag; $stop_pos > -1 ? return substr $stuff, $start_pos, $stop_pos - $start_pos + length $stop_tag : return substr $stuff, $start_pos, -1; } my $good_stuff = find_between_tags($stuff, "START", "END"); # print $good_stuff; PARTICLE # prove they all work, uncomment the prints # (we don't want to print when benchmarking) # uncomment these evals # eval $mine; # eval $yours; # Benchmark those suckers timethese(100000,{ 'Mine' => $mine, 'Yours' => $yours, 'Particle' => $particle });