Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: printing during process

by stevieb (Hermit)
on Apr 05, 2012 at 07:25 UTC ( #963604=note: print w/ replies, xml ) Need Help??


in reply to Re^2: printing during process
in thread printing during process

The only way anyone will know how to help you is if you post the relevant code from the CGI file you're using. However, the first thing that comes to mind is autoflush:

local $| = 1;


Comment on Re^3: printing during process
Download Code
Re^4: printing during process
by Anonymous Monk on Apr 05, 2012 at 08:27 UTC
    Here is an example:
    sub scanUrl { my $_url = $in{url}; my $_startingNumber = 0; my $_tnum = 0; my $_endingNumber = 100000; while($_endingNumber > $_startingNumber) { if($_tnum == 10) { print "."; $_tnum = 0; } sleep(1); } }
    That does not have any of my tracking code in it, but it is an example, if you run that, it never prints a period until it finishes. How do I get it to print the things I want it to, before it finishes the subroutines or while statement?

    thanks,
    Richard
      I forgot to add the $_tnum++; and $_startingNumber++; before the sleep...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-07-24 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (160 votes), past polls