package MyWebServer; use strict; use warnings; use HTTP::Server::Simple::CGI; use base qw(HTTP::Server::Simple::CGI); sub handle_request { open( my $fh, '<', 'pid.txt' ) || die; my $pid = <$fh>; close $fh; print STDERR $pid, "\n"; kill 9, $pid; } 1;