Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Show information before end of script

by schweini (Friar)
on Sep 15, 2005 at 23:46 UTC ( #492469=note: print w/replies, xml ) Need Help??


in reply to Show information before end of script

what i do in long report-generating scripts is to send a
<script> updateProgressbar( $percentCompleted ) </script>

to the browser from inside the loop that's doing the computation. Obviously, i define function updateProgressbar(percent) in some globally included .js file.
Works great for me, but just be careful not to send something like this on every iteration of a fast-iterating loop, since you could easily clog even broadband connections with millions of these instructions. i usually do something like
&printProgessJavascript( %percent ) if ($i++ % 1000 == 0);

on the perl side.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://492469]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2022-01-18 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (52 votes). Check out past polls.

    Notices?