If you have your action in a variable, I assume that you have more than one action. If so, set up a dispatch table.
my %function = ( post => \&post, read => \&read, default => \&default ); my $action = get_action(); $action = 'default' unless ( exists $function{$action} ); $function{$action}->( @arg_list );
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
In reply to Re: variable function thingy
by Ovid
in thread variable function thingy
by nujersedvl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |