Help for this page

Select Code to Download


  1. or download this
    my $bar = sub { # do something here };
    $bar->(); # executes the stuff in the anonymous sub above
    
  2. or download this
    sub foo {
         # do something here
    ...
    
    my $bar = \&foo;
    $bar->(); #executes the stuff in foo()
    
  3. or download this
    my %actions = (
         foo => \&do_foo, # some long operation
    ...
    else {
         $actions{ default }->();
    }