PerlModule Apache2::Hello404
SetHandler perl-script
PerlResponseHandler Apache2::Hello404
package Apache2::Hello404;
use Apache2::RequestRec;
use Apache2::RequestIO;
use Apache2::Const -compile => qw(OK NOT_FOUND);
sub handler {
my $r = shift;
my $package = __PACKAGE__;
my $req = Apache2::Request->new($r);
my $val = $req->param('key') || '';
my $msg = $val ? qq{You passed in a value of "$val" for "key"} :
'No "key" parameter was passed ';
my $time = scalar localtime;
$r->status(Apache2::Const::NOT_FOUND);
$r->content_type('text/html');
$r->print(<<"END");
$package handler
Hello from $package. It is $time.
$msg
END
return Apache2::Const::OK;
}
1;