Help for this page

Select Code to Download


  1. or download this
    #!perl -w
    use strict;
    ...
        'foreach' => sub { my $sum=0; foreach (1..100) { foreach (1..100) 
    +{ $sum++ }}},
        'map' => sub {my $sum=0; map { map { $sum++ } (1..100) } (1..100) 
    +},
    });
    
  2. or download this
    ------------------------------
    
             Rate     map foreach
    map     345/s      --    -43%
    foreach 603/s     75%      --