Hello Monks,
Want to know about CGI. I have a script burn.pl, which creates a web page using CGI.pm. Simple enough. Now, inside this, it should fork another perl script, called sleep.pl, which should sleep until I send it a SIGALRM. This all works, but the web page continues to have the hour glass (like the page is waiting for input from the CGI) until I send my sleeping process the SIGALRM. How would I get the web page to do the complete job (i.e. not wait with the hourglass) while still running the sleep.pl in the background?

#!/usr/bin/perl -w #Create initial feedback page use CGI ':standard'; my $query=new CGI; print $query->header("text/html"); print $query->start_html(-title => "This is my first web page generate +d via CGI"); print $query->h1('This is the header document'); print <<EOF; This is the body of the document<br/> What goes in here is really anything you wish to put in here<br/> EOF if ( my $pid = fork() ) { system ("./sleepme.pl"); exit; # This current process } else { print $query->end_html; }

My sleep.pl is simple:
#!/usr/bin/perl -w sleep; exit;
I know little about CGI, so this is all a bit new to me.
Thanks
H

20040504 Edit by broquaint: Changed title from 'CGI question - getting rid of the hour glass'


In reply to Closing parent CGI after fork() by hambo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.