SetHandler perl-scriptPerlHandler Mar22::Hellosub handler{}
for that kind of request.
use Apache::Constants qw(:common);
sub handler {
my $r = shift; # Apache request object
# do stuff
return OK; # return a valid Apache status code.
}
1;
User www ", instead we can write
<Perl>
my $hostname = `hostname`;
$User = 'www' if $hostname =~ /^papa-bear/;
$User = 'httpd' if $hostname =~ /^momma-bear/;
$User = 'nobody' if $hostname =~ /^goldilocks/;
</Perl>
Otherwise, what you want to do is get a feel for what's out there and how its been done so you can snarf various code fragments and know basically what's going on.
So, from the stuff above, at least peruse the examples from this lecture and the material in the mod_perl guide, http://perl.apache.org/guide/, depending on what strikes your fancy. The $r request object, Apache API, response codes and all that are described in detail in this reference chapter from the Apache Modules book; you may want to refer to that as you're looking at the examples.