11 return $self->handler();
16 shift->{cgi} = CGI::Simple->new();
21 $self->{path} = $self->{cgi}->url( -absolute => 1, -path_info => 1 );
22 my $loc = $self->{cgi}->url( -absolute => 1 );
23 no warnings 'uninitialized';
24 $self->{path} =~ s/^($loc)?\///;
31 my (%vars) = $self->{cgi}->Vars;
32 while ( my ( $key, $value ) = each %vars ) {
33 my @values = split "\0", $value;
34 $vars{$key} = @values <= 1 ? $values[0] : \@values;
36 $self->{params} = {%vars};
37 $self->{query} = {%vars};
42 print $r->{cgi}->header(
43 -type => $r->{content_type},
44 -charset => $r->{document_encoding},
45 -content_length => length $r->{output},
50 sub get_template_root {
52 $r->{cgi}->document_root . "/" . $r->{cgi}->url( -relative => 1 );
59 CGI::Maypole - CGI-based front-end to Maypole
64 use base 'CGI::Maypole;
65 BeerDB->setup("dbi:mysql:beerdb");
66 BeerDB->config->uri_base("http://your.site/cgi-bin/beer.cgi/");
67 BeerDB->config->display_tables([qw[beer brewery pub style]]);
68 # Now set up your database:
83 This is a handler for Maypole which will use the CGI instead of Apache's
84 C<mod_perl> 1.x. This handler can also be used for Apache 2.0.
92 Call this from your CGI script to start the Maypole application.
98 This class overrides a set of methods in the base Maypole class to provide it's
99 functionality. See L<Maypole> for these:
105 =item get_template_root
117 Dave Ranney C<dave@sialia.com>
119 Simon Cozens C<simon@cpan.org>