I suppose I'm nitpicking here, but something has always bothered me about this answer (and those like it). Perl already provides a perfectly code "dispatch table", that is, a hash that maps subroutine names to subroutine references! I'm not sure why people are so strongly discouarged from using it. It's one thing to discourage accessing this hash for variables, since that leads to global variables and other such evil, but in this case you're just wasting effort to create something that already exists.
Re^2: How to sovle this, if i use strict i'm getting error.
Replies are listed 'Best First'.
The point is control. Eval-based dispatch is much like an unstructured goto $EXPR - you cannot really be sure of the program flow. An explicit hash lists all locations where the code is allowed to branch to. This prevents malicious attacks where the attacker could try to make a call to the exit or system core function and it allows much better error handling. It also decouples the subroutine name from the argument, which I find very convenient in web applications.