in reply to Reducing the complexity of dispatch tables

Your entire dispatch table can be replaced by the following 2 lines:

$action = $apr->param('a') || 'home'; render_template( $action, $action );

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Reducing the complexity of dispatch tables
by moritz (Cardinal) on Aug 31, 2007 at 17:48 UTC
    Not quite: in this version an invalid but defined $action will reach render_template.
Re^2: Reducing the complexity of dispatch tables
by jdporter (Paladin) on Aug 31, 2007 at 19:12 UTC

    Um... What about the samp entry, which runs the sample subroutine?