Apache-SimpleTemplate
view release on metacpan or search on metacpan
1) put the httpd.conf lines above into your httpd.conf
2) restart apache
3) try putting an example template from below into your document root
4) point your browser at the example
DEPENDENCIES
The only dependency is mod_perl.
(CGI::Simple and CGI::Upload are required if you're doing file uploads.)
COPYRIGHT AND LICENSE
Copyright (c) 2001-2006, Peter Forty
This is free software with no warranty.
You may use it, distribute it, and/or modify
it under the same terms as Perl itself.
SimpleTemplate.pm view on Meta::CPAN
# foreach my $pair (split('&', $ENV{QUERY_STRING})) {
elsif (($r && $r->args) || $ENV{QUERY_STRING}) {
foreach my $pair (split('&', (($r && $r->args) ? $r->args : $ENV{QUERY_STRING}))) {
my ($k, $v) = split('=', $pair);
push (@form, &decode($k), &decode($v));
}
}
if (($r) && ($r->method() eq 'POST') && ($r->header_in('Content-Length') > 0)) {
# handle upload posts
if ($r->header_in('Content-Type') =~ m/multipart\/form-data/i) {
use CGI;
$CGI::DISABLE_UPLOADS = 0;
my $cgi = CGI->new();
foreach my $k (keys %{$cgi->Vars}) { $form{$k} = $cgi->param($k); }
use CGI::Upload;
my $upload = CGI::Upload->new({ query => $cgi });
$s->{upload} = $upload;
}
# handle other posts
else {
push @form, $r->content();
}
# blank this so we don't think there's more to read
$r->header_in('Content-Length', 0);
}
SimpleTemplate.pm view on Meta::CPAN
=head1 INSTALLATION
The only requirement is mod_perl**. To install Apache::SimpleTemplate, run:
perl Makefile.PL
make
make install
(** Version 0.06 works with mod_perl2 in compatibility mode. Older versions
may work better with mod_perl1. The CGI library is needed if you want
file upload support.)
Then, to test it with Apache/mod_perl:
1) put the httpd.conf lines above into your httpd.conf
2) restart apache
3) try putting an example template from below into your document root
4) point your browser at the example
( run in 0.784 second using v1.01-cache-2.11-cpan-b16cb0d3907 )