[cgiapp] CGI::Application::Dispatch Question

Michael Peters mpeters at plusthree.com
Fri May 7 11:12:46 EDT 2010


On 05/07/2010 11:09 AM, Brad Van Sickle wrote:

> example:
> I have the URI - /Home and I want to translate that to rm=Content and
> populate the $self->param('Session') "variable" with "Home"  Today I
> simply use mod_rewrite to translate that URI into
> /index.pl?rm=Content&Section=Home and then pull the section out of the
> cgi query string, rather than $self with $cgi->param("Section").

Dispatch supports an args_to_new option to pass data into the CGI::App 
object when creating it. So something like this should work:

   '/Home' => {
        app         => 'Blah',
        rm          => 'Content',
        args_to_new => { PARAMS => 'Home' },
    },

-- 
Michael Peters
Plus Three, LP


More information about the cgiapp mailing list