use strict; use warnings FATAL => 'all', NONFATAL => 'redefine'; use Apache2::Const -compile => qw(HTTP_NO_CONTENT); use Apache2::Request(); use Apache2::RequestUtil(); use Data::Dumper; my $r = shift; my $req = Apache2::Request->new($r); $r->content_type('text/plain'); $r->status(Apache2::Const::HTTP_NO_CONTENT); my ($s, $m, $h, $D, $M, $Y) = (localtime($r->request_time))[0..5]; my $date = sprintf( "%04d-%02d-%02d %02d:%02d:%02d", $Y+1900, $M+1, $D, $h, $m, $s ); { my $filename = '/var/tmp/listen'; open my $fh, '>>', $filename or die "could not open <$filename> for append: $!"; syswrite $fh, $date."\n". $r->as_string."\n\n\n"; syswrite $fh, Dumper($req->body); close $fh; };