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} .= '/' if $self->{path} eq $loc;
25 $self->{path} =~ s/^($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 BeerDB->config->template_root("/var/www/beerdb/");
70 # Now set up your database:
83 Now to access the beer database, type this URL into your browser:
84 http://your.site/cgi-bin/beer.cgi/frontpage
88 This is a handler for Maypole which will use the CGI instead of Apache's
89 C<mod_perl> 1.x. This handler can also be used for Apache 2.0.
97 Call this from your CGI script to start the Maypole application.
101 =head1 Implementation
103 This class overrides a set of methods in the base Maypole class to provide it's
104 functionality. See L<Maypole> for these:
110 =item get_template_root
122 Dave Ranney C<dave@sialia.com>
124 Simon Cozens C<simon@cpan.org>