- or download this
if (defined($q->param())) {
if ($q->param('action') eq 'add') {
...
} else {
&action_dialog();
}
- or download this
sub get_branch_function {
my $query = shift;
...
return $dispatch{ $action }{ confirm }{ commit };
}
}
- or download this
my %dispatch = (
add => {
...
},
default => \&choose_dialog,
},
- or download this
modify => {
update => {
...
},
default => \&choose_dialog,
},
- or download this
default => \&action_dialog
);
- or download this
sub dispatch_table {
my $q = shift;
...
},
default => \&action_dialog
);
- or download this
if (! exists $dispatch{$action}) {
return $dispatch{default}
...
return $dispatch{$action}{confirm}{commit};
}
}