#!/usr/bin/perl use Benchmark qw(:all); cmpthese( 10000, { 'regex' => sub {my $string = 'Hallo, Welt blub blub, foo, bar.' x 1000; $string =~ s/,//g; }, 'trans' => sub {my $string = 'Hallo, Welt blub blub, foo, bar.' x 1000; $string =~ tr/,//d }, });