in reply to Trigger perl scrip remotely using http
#!/usr/bin/perl use strict; use warnings; $SIG{CHLD} = 'IGNORE'; if (fork()) { print "Content-type: text/html\n\n"; print "ok"; exit; } close(STDIN); close(STDOUT); close(STDERR); #start doing lots of things that are time consuming blah1(); blah2(); ...
You can add error checking to fork and direct STDERR to a log file, but you get the idea.
A better solution would provide feedback to the user. This article shows how it can be done.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Trigger perl scrip remotely using http
by saberworks (Curate) on Mar 25, 2009 at 21:21 UTC | |
|
Re^2: Trigger perl scrip remotely using http
by rethaew (Sexton) on Mar 25, 2009 at 23:20 UTC |