in reply to Re: problem with removing space
in thread problem with removing space

For better performances you'd probably prefer to use a translation instead of a substitution.

perl -MBenchmark -e 'timethese(1000000,{ "s" => "$_=qq(a a a a a a ); s/ /_/g", "tr" => "$_=qq(a a a a a a ); tr/ /_/", })' Benchmark: timing 1000000 iterations of s, tr... s: 15 wallclock secs (13.81 usr + 0.00 sys = 13.81 CPU) @ 72411.30/s (n=1000000) tr: 5 wallclock secs ( 4.38 usr + 0.00 sys = 4.38 CPU) @ 228519.20/s (n=1000000)
<kbd>--
my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>