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)?\///;
30 my (%vars) = $self->{cgi}->Vars;
31 while ( my ( $key, $value ) = each %vars ) {
32 my @values = split "\0", $value;
33 $vars{$key} = @values == 1 ? $values[0] : \@values;
35 $self->{params} = {%vars};
36 $self->{query} = {%vars};
41 print $r->{cgi}->header(
42 -type => $r->{content_type},
43 -charset => $r->{document_encoding},
44 -content_length => length $r->{output},
49 sub get_template_root {
51 $r->{cgi}->document_root . "/" . $r->{cgi}->url( -relative => 1 );
58 CGI::Maypole - CGI-based front-end to Maypole
63 use base 'CGI::Maypole;
64 BeerDB->setup("dbi:mysql:beerdb");
65 BeerDB->config->uri_base("http://your.site/cgi-bin/beer.cgi/");
66 BeerDB->config->display_tables([qw[beer brewery pub style]]);
67 # Now set up your database:
82 This is a handler for Maypole which will use the CGI instead of Apache's
83 C<mod_perl> 1.x. This handler can also be used for Apache 2.0.
87 Dave Ranney C<dave@sialia.com>
89 Simon Cozens C<simon@cpan.org>