Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

launcing long cgi scripts

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is it possible to launch a long process and return a page before it's finished, preferrably in Perl? (Windows platform, IIS + frontpage extensions). Thanks!
 
You might take a look at the 'exec' function. It starts a new process and immediately dies. The new process goes on it's way doing whatever. You would need to complete all of the HTML output prior to doing the 'exec'.

Code:
#!/usr/local/bin/perl
use CGI;
$| = 1; # set autoflush to 'on'
my $object = new CGI;
print $object->header,
      $object->start_html,
      &quot;<p>Starting the new processes shortly</p>&quot;,
      $object->end_html;

exec &quot;system_command, @args&quot;;

That would print a very simple html page and then fire whatever system_command you indicated.

See 'perldoc exec' from a command prompt to get details on 'exec'. 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top