I had a feeling you'd say that. :-)
You would be generating code based on user input (data from outside). Most monks will argue quite strenuously that this is a bad idea. Really.
You will be tempted to turn off strict and warnings, you will probably have to turn off taint mode too.
Your code should decide which sub to run, not the the user.
Have a look at the Tutorials on web programing (particularly Security in CGI Programming) and, please, take another look at dispatch tables.
update: added link