C:\>perl test.pl Benchmark: timing 100000 iterations of Mine, Particle, Yours... Mine: 5 wallclock secs ( 4.06 usr + 0.00 sys = 4.06 CPU) @ 24630.54/s ( n=100000) Particle: 8 wallclock secs ( 7.20 usr + 0.00 sys = 7.20 CPU) @ 13888.89/s ( n=100000) Yours: 25 wallclock secs (24.67 usr + 0.00 sys = 24.67 CPU) @ 4053.51/s (n =100000) C:\> #### 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 });