CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Timeout Problem

 



itwontgo
Novice

Nov 3, 2008, 8:48 AM

Post #1 of 4 (505 views)
Timeout Problem Can't Post


Code
foreach(@mailbox) { 
blah(blah); .....
timeout(5) { system $mail $document; }
}


I basically need to do a timeout on a system function and I can't figure out how to do it. Anyone know any modules or code to do a 5 second timeout like this?

Thanks!


KevinR
Veteran


Nov 3, 2008, 9:11 AM

Post #2 of 4 (502 views)
Re: [itwontgo] Timeout Problem [In reply to] Can't Post

sleep(5)
-------------------------------------------------


itwontgo
Novice

Nov 3, 2008, 9:18 AM

Post #3 of 4 (501 views)
Re: [KevinR] Timeout Problem [In reply to] Can't Post


In Reply To
sleep(5)


I don't want to sleep, I want a timeout. After it runs 'HERE' code timeout(5) { HERE }, after 5 seconds i want it to kill or interrupt or otherwise go on with the next part of the code.

Thanks.


KevinR
Veteran


Nov 3, 2008, 9:55 AM

Post #4 of 4 (496 views)
Re: [itwontgo] Timeout Problem [In reply to] Can't Post

maybe you want to set an alarm(). Or hopefully someone that understands better than I do what timeout does will have a more relevent suggestion if alarm() is also not what you need to use.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives