Help for this page

Select Code to Download


  1. or download this
    #!perl
    use Benchmark;
    my $junk = 'The quick brown fox Jumped over the lazy dog';
    ...
      'trans'    => sub { ($x = $junk) =~ tr/ \t\r\n//d; },
      'subst'    => sub { ($x = $junk) =~ s/\s+//g; },
    });
    
  2. or download this
    Benchmark: running split, subst, trans, each for at least 10 CPU secon
    +ds...
         split:  43912.46/s
         subst:  66211.19/s
         trans: 197755.00/s