[cgiapp] Program format (this is the way I write my code -help?)

Mark Fuller azfuller at gmail.com
Wed Feb 13 20:16:56 EST 2008


On Feb 13, 2008 6:02 PM, Lou Hernsen <lhernsen1015 at wowway.com> wrote:
> Ok thanks.. reading.. absorbing... percieving but still not grokking...

The run modes that were mentioned are just a way to abstract the URL
to a subroutine to handle whatever action is associated with that URL.
C::A does the "if/else" logic for you. You just have to register the
URL (either a parameter on the URL, or in the POSTed form) and
associate it with a subroutine. When the application is invoked with
that parameter (or form value) it will automatically call the
subroutine.

If you read those two articles you'll get the idea.

There's a plug-in that might make it easier for you (but, I personally
like traditional run modes):

http://search.cpan.org/~jaywhy/CGI-Application-Plugin-ActionDispatch-0.91/lib/CGI/Application/Plugin/ActionDispatch.pm

This lets you specify the URL with each subroutine. If the URL
matches, that's the subroutine that's executed. No run modes.

Mark


More information about the cgiapp mailing list