[cgiapp] Dispatching both 'login' and 'login/*' to the same app?

Clayton Scott clayton.scott at gmail.com
Tue Feb 24 11:56:31 EST 2009


First off, thanks everyone for the work on CGI::Application and
CGI::Application::Dispatch.
I love working with them.

Here is my issue:

I want want both '/login' and '/login/*' to go to the same App but I
can't see how to do it
short of overriding _parse_path in a sub-class.

In my table I've tried using the key 'login', 'login*', 'login/*' but
one will always fail to match
one or the other.

Please tell me there's another way to do it!

index.cgi
#!/usr/bin/perl
    CGI::Application::Dispatch->dispatch(
                prefix  => 'My::App::Dashboard',
                table   => [
                            ''           => { app => 'Home' },
                            'login*'   => { app => 'Login::Ajax' },
#matches 'login/' but not 'login'
                ],
                debug   => 1,
        );





Thanks,
Clayton


More information about the cgiapp mailing list