Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: CGI::Application, inheritance trees, and 'the right way'

by dragonchild (Archbishop)
on Nov 02, 2004 at 14:05 UTC ( [id://404595]=note: print w/replies, xml ) Need Help??


in reply to CGI::Application, inheritance trees, and 'the right way'

There are a huge number of plugins for CGI::Application. The one you're looking for is CGI::Application::Dispatch. It will handle all those things for you in a simple fashion.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: CGI::Application, inheritance trees, and 'the right way'
by drewbie (Chaplain) on Nov 02, 2004 at 18:45 UTC
    Seconded. See my earlier reply to saberworks post. I've started using it in a real-world application and it works quite nicely. I have a couple patches into the author for some enhancements I needed, who seems willing to put them in. :-) If you're interested the patches include:
    • Passing in the pre-translated application name to the application. Useful if you want to programatically create links between applications.
    • Under CGI mode, pass-along any params set via new() in the instance script.
    It makes it very easy to setup multiple applications w/o having to add <Location> (mod_perl) or instance scripts (CGI) for each one.
Re^2: CGI::Application, inheritance trees, and 'the right way'
by geektron (Curate) on Nov 02, 2004 at 17:33 UTC
    that, in fact, does look like the cleanest solution.

    from the perldoc, i guess my  form action would just have the module name on it? like:

    <form name='add' method='post' action='/cgi-bin/index.cgi/EventMana +ger/'>
    and the hidden fields for RM would still apply?
      I'm not quite sure how that works, as I've never used it myself. Try it out with a few toy classes and see what happens. Alternatively, you can ask on the CGI::Application mailing list, which is where I heard about this.

      Being right, does not endow the right to be rude; politeness costs nothing.
      Being unknowing, is not the same as being stupid.
      Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
      Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

        actually, adding the dispatched class to the form method *just works*, which is nice. i just have to play with some of my direct links, see if i should tack on ?rm=foo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-03-29 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found