Robert Hicks wrote:
> I am just coming up to speed on this one.
>
> I am wondering if I am reading the pod right.
>
> Am I replacing "use base 'CGI::Application'" with "use base
> 'CGI::Application::Dispatch'"?
No. Dispatch is not a base class for a C::A application. Dispatch sits outside
of your applications. You shouldn't need to change your application modules. You
can think of Dispatch as a way to gather different app modules under the same roof.
If you are planning on using Dispatch under mod_perl then you'd most likely
create a subclass of dispatch which contains a dispatch_args() method and then
put something like this in your httpd.conf file:
PerlHandler Abrams::Dispatch
If you're using it under normal CGI (or even FCGI) then you'd probably just
create a single index.pl script that uses Abrams::Dispatch like so:
#!/usr/bin/perl
use strict;
use Abrams::Dispatch;
Abrams::Dispatch->dispatch();
> Then if my module name is "package Abrams" I would build a dispatch
> table for my runmodes:
>
> sub dispatch_ars {
> return {
> prefix => 'Abrams',
> table => [
> '' => { app => 'Welcome', rm => 'start' },
> '' => { app => 'Contacts', rm => 'contacts' },
> ':app/:rm' => {},
> ],
> };
> }
That looks like a good dispatch table to me.
> Now I am using CAP::AutoRunmode currently and I have:
I've never used AutoRunmode with Dispatch so I'm not sure how well they play
together. Anyone else use them together?
--
Michael Peters
Developer
Plus Three, LP
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.