The easiest way to do this (IMHO) is to use the register_cleanup method in
mod_perl. This gets executed at the very end of the request cycle after
the TCP connection gets closed. See page 367 of the Eagle book for
details...
Basically you want to do this:
$r = Apache->request;
$r->register_cleanup( sub { system("/path/to/your/script.pl"); } );
-T.J. Mather
On Tue, 29 Aug 2000, martin langhoff wrote:
> i need to start a long-running script from either mod_perl or mod_cgi,
> and I'm facing all the well-known issues: the apache child waits, until
> it waits no longer (maybe because the browser itself chose to close the
> TCP connection, maybe because of an internal timeout), and then the
> script gets killed.
>
> there is no useful information to echo back to the user, besides
> teloing him the script started ok.
>
> the problem is: while I'm familiar with the problems, but not with the
> solutions. I've read that one possible solution is to use fork(), but I
> have no experience with it, and not much understanding of its
> implications, and after reading perlfunc I'm more confused than before.