Help for this page

Select Code to Download


  1. or download this
    $n = 10_000_000;
    print ": ";  <>;                                       # 2MB
    $f = 1;
    for (0..$n-1) { if ($f) { $f = 0; print ": "; <>; } }  # 2MB
    
  2. or download this
    $n = 10_000_000;
    print ": "; <>;                                   #   2MB
    ...
    print ": ";  <>;                                  # 240MB
    $f = 1;
    for (@a) { if ($f) { $f = 0; print ": "; <>; } }  # 240MB
    
  3. or download this
    $n = 10_000_000;
    print ": ";  <>;                                         #   2MB
    $f = 1;
    grep { if ($f) { $f = 0; print ": "; <>; } 0 } 0..$n-1;  # 240MB  <--
    
  4. or download this
    $n = 10_000_000;
    print ": "; <>;                                     #   2MB
    ...
    print ": "; <>;                                     # 240MB
    $f = 1;
    grep { if ($f) { $f = 0; print ": "; <>; } 0 } @a;  # 280MB  <--