in reply to Re: Re: executing other scripts while printing a webpage
in thread executing other scripts while printing a webpage

In that case, don't bother calling script B a ".cgi", since it is really a stand-alone process. CGI programs are intended to be run directly by the client, which means they operate a little differently than regular programs. For instance, using CGI.pm, they require a bit of input from STDIN to get going, unless you specify parameters on the command line.

How about this:
if (file_is_too_old()) { unless (fork()) { exec ("update_script"); } }
Remember that, unless you're using an SUID script, the "update_script" will be run as your Web user, which is traditionally 'nobody'. Make sure that this user has all the required privileges to update your files, or that the SUID user does.