=head1 NAME Content Handler Example =head1 Creating a content handler with mod_perl 1.0 Handlers are simply perl subroutines called by the server at various stages of the HTTP request cycle. A content handler is a subroutine that is called by the response phase. Handlers, are typically created as a perl modules, separate files store in a library, and accessible via perl's C<@INC> array. For example, here's an example that returns a greeting and the current local time. file:My/Greeting.pm ------------------- package My::Greeting; use strict; use Apache::Constants qw(OK); sub handler { my $r = shift; my $now = scalar localtime; my $server_name = $r->server->server_hostname; $r->send_http_header('text/plain'); print <). Now, to return the above greeting when the URL I is visited on your server: SetHandler perl-script PerlHandler My::Greeting For a more in-depth explanation of creating mod_perl handlers, and mod_perl in general, see the L. =for html « back