in reply to variable function thingy
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.
|
|---|