Help for this page

Select Code to Download


  1. or download this
    #!perl
    use Benchmark;
    my $junk =
    ...
      'subst2'   => sub { ($x = $junk) =~ s/^\s+//; $x =~ s/\s+$//;
                          $x =~ s/\s+/ /g; },
    });
    
  2. or download this
    Benchmark: running split, subst, subst2, trans,
      each for at least 10 CPU seconds...
         split: 41225.50/s
         subst: 40796.61/s
        subst2: 38222.28/s
         trans: 72880.42/s