- or download this
sub this {
return "this"; # Whatever
...
return "that"; # Being simple here
}
# etc
- or download this
my %action = (
this => sub {return "this"},
...
if (exists $action{$in}) {
$action{in}->();
}
- or download this
sub ret_simple_returner {
my $arg = shift;
...
}
my %action = map ret_simple_returner($_), qw(this that);