[cgiapp] a CGI::Application::Dispatch problem

ximiff ximiff at gmail.com
Tue Jan 13 22:14:03 EST 2009


hi all,

directory /cgi-bin/test/ has two files , test_ca.pm and test_ca.cgi

<code>
#test_ca.pm
package test_ca;
use strict;
use warnings;
use Data::Dumper;
use base 'CGI::Application';
sub setup
{
my $self = shift;
$self->mode_param('rm');
$self->start_mode('showform');
$self->run_modes([qw/do1 do2 do3/]); 
}
sub cgiapp_postrun {
my $self = shift;
$self->header_add( -charset => 'gbk' );
}
sub do1
{
return '<html><body><p>do1</p></body></html>';
}

#test_ca.cgi
use base 'CGI::Application::Dispatch';
CGI::Application::Dispatch->dispatch(
        prefix              => '',
        table               => [
            ':app/:rm'  => { },
        ],
# debug => 1,
);
</code>

now i visit the url http://mywebsite/cgi-bin/test/test_ca.cgi/test_ca/do1 ,and browser returned "404 not found".
this is my first time to use CGI::Application::Dispatch moudle, and i need your help.

2009-01-14 



ximiff 


More information about the cgiapp mailing list