Help for this page

Select Code to Download


  1. or download this
    package Cleaner;
    sub new 
    ...
    $foo = "\t\tFOO\t\t";
    $c->clean($foo);
    print $foo, "\n";
    
  2. or download this
    package main;
    $c = new Cleaner;
    ...
        'blessed' => sub { my $bar = $foo; $c->clean($bar) },
        'normal'  => sub { my $bar = $foo; $bar =~ s/^\s+|\s$//g },
    });
    
  3. or download this
    Benchmark: timing 1000000 iterations of blessed, normal...
       blessed: 43 wallclock secs (36.50 usr +  0.14 sys = 36.64 CPU)
        normal: 28 wallclock secs (24.19 usr +  0.08 sys = 24.27 CPU)