Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Pause Perl Script Execution

by oxone (Friar)
on Sep 08, 2007 at 15:25 UTC ( #637842=note: print w/ replies, xml ) Need Help??


in reply to Pause Perl Script Execution

Assuming the file in question will be created by something external to your Perl script and you just want to wait:

sleep 1 while !-e 'myfile.txt';
Note that !-e means "file doesn't exist". This will keep looping and checking every 1 second forever, and move on only if the relevant file appears.


Comment on Re: Pause Perl Script Execution
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2014-09-22 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (178 votes), past polls