#!/usr/bin/perl use Benchmark qw/timethese/; $string = q/Some text repeated / x 50; timethese(-3, { MZSanford => '$chunk = substr($string,0,201);$chunk =~ s/\s+\w*$//', Hofmator => '($chunk) = substr($string,0,201) =~ /(.*)\s+\w*$/', japhy => '($chunk) = $string =~ /^(.{1,200})(? '($chunk) = $string =~ /^(.{0,199}\S)\s/', });