Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Reducing the complexity of dispatch tables

by BrowserUk (Patriarch)
on Aug 31, 2007 at 17:15 UTC ( [id://636387]=note: print w/replies, xml ) Need Help??


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.

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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://636387]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-19 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found