mike_gerard has asked for the wisdom of the Perl Monks concerning the following question:

Hello Frères (French for Monks!). I have a Perl-coded Web server, using the CGI module (of course). In a results frame I sometimes have to make the server work hard, taking some time. During that time I would like to put a reassuring message into the frame until the results are available. As of that time I essentially want to blank out the reassurance message and restart the frame (but not repeat the work, of course). Everything that I have tried so far has failed! Help!

Replies are listed 'Best First'.
Re: CGI / HTML problem
by Corion (Patriarch) on Dec 23, 2008 at 10:14 UTC
Re: CGI and/or HTML problem
by ksublondie (Friar) on Dec 23, 2008 at 15:21 UTC
    What I've always done in the past is use javascript to display a div tag (which I hide on page load) after hitting the submit button. Something like this:
    <div id="waitBox" style="background-color: #d6e7fe; font-family:Arial, +Helvetica, sans-serif; font-size: 10pt; font-weight: bold;color: #000000;text-align: left; position:absolute; +border: thin solid #1A448E; padding: 5px; display: none; z-index: 3000; width:250px; height:75px;"></div> <script type="text/javascript"> function showWait(status){ var object=document.getElementById('waitBox'); if(status){ object.style.left = (document.body.clientWidth - 250) +/ 2; object.style.top = document.body.scrollTop + (document +.body.clientHeight - 75) / 2; object.style.display = "block"; object.innerHTML='<br><center>Please wait while your s +earch is being performed...</center>'; }else{object.style.display = "none";} } </script> <form action="script.pl" method="post" name="form1"> <input type="button" onclick="showWait(1);this.form.submit();" value=" +Search"> </form>
      Although I have not yet understood this (it is late at night here!) I read it as offering the user a button, which appears somewhere when the submit (done from a separate frame) is clicked. Not exactly what I had in mind, but maybe it can be adopted. Really, I would like to keep the user updated as to what the main script is doing (and can take a variable amount of time which I cannot estimate in advance). I would have preferred to stay purely in Perl, not having much Javascript knowledge.
Re: CGI and/or HTML problem
by Dru (Hermit) on Dec 23, 2008 at 15:49 UTC
Re: CGI / HTML problem
by laceytech (Pilgrim) on Dec 23, 2008 at 21:17 UTC
    I sometimes print a '.' while looping over data.
    This is not elegant, or pretty and does not get erased when the real data arrives. It is easy and gives the user some feedback.