#!/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(); ...