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)?\///;
25 $self->{path} .= '/' if $self->{path} eq $loc;
32 my (%vars) = $self->{cgi}->Vars;
33 while ( my ( $key, $value ) = each %vars ) {
34 my @values = split "\0", $value;
35 $vars{$key} = @values <= 1 ? $values[0] : \@values;
37 $self->{params} = {%vars};
38 $self->{query} = {%vars};
43 print $r->{cgi}->header(
44 -type => $r->{content_type},
45 -charset => $r->{document_encoding},
46 -content_length => do { use bytes; length $r->{output} },
51 sub get_template_root {
53 $r->{cgi}->document_root . "/" . $r->{cgi}->url( -relative => 1 );
60 CGI::Maypole - CGI-based front-end to Maypole
65 use base 'CGI::Maypole;
66 BeerDB->setup("dbi:mysql:beerdb");
67 BeerDB->config->uri_base("http://your.site/cgi-bin/beer.cgi/");
68 BeerDB->config->display_tables([qw[beer brewery pub style]]);
69 # Now set up your database:
84 This is a handler for Maypole which will use the CGI instead of Apache's
85 C<mod_perl> 1.x. This handler can also be used for Apache 2.0.
93 Call this from your CGI script to start the Maypole application.
99 This class overrides a set of methods in the base Maypole class to provide it's
100 functionality. See L<Maypole> for these:
106 =item get_template_root
118 Dave Ranney C<dave@sialia.com>
120 Simon Cozens C<simon@cpan.org>