Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: sleep in while loop

by arturo (Vicar)
on Aug 05, 2002 at 16:11 UTC ( #187729=note: print w/replies, xml ) Need Help??


in reply to sleep in while loop

It's hard to know what's going on unless you've tell us more about what's going on in the ".. do something" part. How do you know your conditional test (which your additions mention) isn't getting executed at all instead of just failing?

Try putting a print in there or something that is guaranteed to execute:

my $entered; while(1) { print "Entered while loop\n" unless $entered++; # get input, read file, read socket, or whatever here # ... if ( $test ) { #... last; } sleep(10); }

HTH

I mistrust all systematizers and avoid them. The will to a system shows a lack of integrity -- F. Nietzsche

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2023-06-09 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (35 votes). Check out past polls.

    Notices?