Help for this page

Select Code to Download


  1. or download this
    my %dispatch = (
        test   => sub { print "test\n"  },
    ...
    
    $name = 'hello';
    $dispatch{$name}->();
    
  2. or download this
    my $name = 'test';
    __PACKAGE__->can("update_$name")->();
    ...
    
    sub update_test  { print "test\n"  }
    sub update_hello { print "hello\n" }