Perl Basics
Introduction to Perl
FAQ's
CGI
Regular Expressions

PC Overview
Cool Stuff
My Modules
Success Stories
Links
Perl in the News
Logos
Perl @ msn
Perl Chat

PC Internals
About
Contact
Guest Book
Handy Logos
What's new

Website in mod_perl fashion

mod_perl Example
See also Website Home
P-friendly

[ home ] - [ search ] - [ sitemap ]

Website in mod_perl fashion

package ModPerl::HelloWebsite;

use strict;
use warnings;
use Website;
use CGI::Lite;

use Apache::RequestRec ();
use Apache::RequestIO ();

use Apache::Const -compile => qw(OK);

sub handler {
	my $r = shift;

	my $cgi = new CGI::Lite;
	my $q = $cgi->parse_form_data ('GET');

	$r->content_type('text/html');

	my $Website = Website->new(
		file => '/usr/lib/perl5/site_perl/ModPerl/website-tpl.htm' );

	$Website->let('firstname', $q->{'firstname'} );
	$Website->let('lastname' , $q->{'lastname' } );

	$Website->print( contentType_is_set => 1, quiet => 1 );

	return Apache::OK;
}

1;


Maybe my home server is switched on:
primus.infocopter.com/Website-Demo
http://www2.infocopter.ch/hello/website/?firstname=foo&lastname=bar
home - feedback - search - web jobs
© 1998-2004 retoh :)