Help for this page

Select Code to Download


  1. or download this
    sub makecounter {
      my $count = 0;
    ...
    }
    
    print $counter2->(), "\n";
    
  2. or download this
    { # create a scope for the closure
      my $count = 0;
    ...
    for (1 .. 5) {
      print counter, "\n";
    }