Help for this page

Select Code to Download


  1. or download this
        my $foo;
    
        sub closure { $foo }
        sub not_closure { 1 }
    
  2. or download this
        my $foo;                 # lexical
        $foo = sub { $foo->() }; # closure
    
        local $bar;              # dynamical
        $bar = sub { $bar->() }; # not a closure