10 return $self->handler();
15 shift->{cgi} = CGI::Simple->new();
20 $self->{path} = $self->{cgi}->url( -absolute => 1, -path_info => 1 );
21 my $loc = $self->{cgi}->url( -absolute => 1 );
22 no warnings 'uninitialized';
23 $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.
88 Dave Ranney C<dave@sialia.com>
90 Simon Cozens C<simon@cpan.org>