Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: printing during process

by Anonymous Monk
on Apr 05, 2012 at 08:27 UTC ( #963610=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^4: printing during process
Download Code
Re^5: printing during process
by Anonymous Monk on Apr 05, 2012 at 08:28 UTC
    I forgot to add the $_tnum++; and $_startingNumber++; before the sleep...
Re^5: printing during process
by Happy-the-monk (Abbot) on Apr 05, 2012 at 08:42 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2015-07-04 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls