- or download this
use CGI qw(:all);
my $op = param('operation');
TestPkg->$dispatch('Hello!') if UNIVERSAL::can('TestPkg', $dispatch);
- or download this
my $input = <>;
$_->($input) for
map /^_/ ? () : *{$TestPkg::{$_}}{CODE} || (),
keys %TestPkg::;
- or download this
my $input = <>;
my $sub;
!/^_/ && *$sub{CODE} && *$sub{CODE}->($input)
while ($_, $sub) = each %TestPkg::;
- or download this
package Foo;
use Dispatch;
...
my $t = Foo->create_dptable;
$t->{bar}->($quux);
- or download this
my $t = {
bar => sub {
...
};
$t->{bar}->($quux);