Help for this page

Select Code to Download


  1. or download this
    use Benchmark qw(:all) ;
    
    ...
                      'regex' => sub { $value =~ /^true$/i },
                      'eq'    => sub { lc $value eq "true" },
                     });
    
  2. or download this
    Benchmark: timing 10000000 iterations of eq, regex...
    
    ...
               Rate regex    eq
    regex  613121/s    --  -45%
    eq    1113586/s   82%    --