#!/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.
In reply to Re: Trigger perl scrip remotely using http
by ikegami
in thread Trigger perl scrip remotely using http
by rethaew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |