Help for this page

Select Code to Download


  1. or download this
    #!perl
    use strict;
    ...
    $closure->($_, $_+1) for (1..4);
    
    print "And my X is $x\n";
    
  2. or download this
    my $closure = sub {
      my ($x, $y) = @_;
      print "Got $x and $y\n";
    };