use Benchmark qw(:all); $toto = 'this+is+my+text+and+here+is+more+and+more+this+is+my+text+and+here+is+more+and+more+this+is+my+text+and+here+is+more+and+more'; $count =-5; $results = timethese($count, { 'transliterate' => sub { $toto = 'this+is+my+text+and+here+is+more+and+more+this+is+my+text+and+here+is+more+and+more+this+is+my+text+and+here+is+more+and+more'; $toto =~tr/+/ /; }, 'substitution' => sub { $toto = 'this+is+my+text+and+here+is+more+and+more+this+is+my+text+and+here+is+more+and+more+this+is+my+text+and+here+is+more+and+more'; $toto =~s/\+/ /g; }, }, 'none' ); cmpthese( $results ) ; exit 0;