Help for this page

Select Code to Download


  1. or download this
    grep {$_ == 0 and $found = 1 and last} @middle;
    
  2. or download this
    { grep {$_ == 0 and $found = 1 and last} @middle; }
    
  3. or download this
    Benchmark: timing 1000 iterations of foreach_middle, grep_middle, hash
    +_middle...
    foreach_middle:  1 wallclock secs ( 0.80 usr +  0.00 sys =  0.80 CPU) 
    +@ 1250.00/s (n=1000)
    grep_middle:  3 wallclock secs ( 3.09 usr +  0.00 sys =  3.09 CPU) @ 3
    +23.62/s (n=1000)
    hash_middle: 30 wallclock secs (26.40 usr +  0.02 sys = 26.42 CPU) @ 3
    +7.85/s (n=1000)