Help for this page

Select Code to Download


  1. or download this
        {
            my $x = 42;
            my $s = sub { $x++ };
            say &$s();
        }
    
  2. or download this
        my $s = sub { state $x = 42; $x++ };
        say &$s();