Sorry about the confusing post. I only put in a fragment of the code and that is where some of it arises from. Essentially I have a module that does the following:
Takes a subroutine as an argument (usually one that takes a long time to run)
Forks off a child to process the subroutine code while the parent creates a temporary "analysis in progress" html page (that refreshes every so often). When the child is finished executing it creates another html page that prints any output from the subroutine, and then overwrites the "analysis in progress" page with the content of this page thus ending the refresh.
I get tired of looking at that screen and wanted to give some kind of progress update and incorporate it into the module. So, in addition to the subroutine used to perform the actual work, I want to take another subroutine as an argument that can be used to give some kind of status on the update. In my case I wanted it to print the number of records that have been inserted into a db of the total number using some DBI code. What I could do with the second subroutine is create a temporary CGI fine that the refresher page redirects to. However, I was hoping to just be able to have the progress subroutine print to the browser directly, that is without needing to generate this temporary cgi file. That is the basis of my question. There may be a much easier way to do this, I am not sure. I hope this makes things clearer.
Also, I was using the script tag to point to the cgi program for historical reasons. The cgi script outputs document.write commands so that part of the script is fine. However, I should just use the redirect as it is easier.
Thanks again.
-jim
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.