in reply to Dynamically calling different functions?
Using a hash for this is very handy.
my %function = ( set => \&set, add => \&add, mul => \&mul ); # later: if (exists $function{ $command } ) { $function{command}->($register,$param); } else { die "No such function: ($command)"; }
Cheers,
Ovid
Looking for work. Here's my resume. Will work for food (plus salary).
New address of my CGI Course.
|
|---|