Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: CountDownTimer for my perl program,

by vinoth.ree (Monsignor)
on Feb 22, 2013 at 07:21 UTC ( #1020089=note: print w/replies, xml ) Need Help??

in reply to CountDownTimer for my perl program,

tmharish ++

Here is the exact code to timeout for 25 minutes.

use strict; use warnings; use utf8; eval { local %SIG; $SIG{ALRM}= sub{ die "timeout reached, after 25 minutes!\n"; }; alarm 25*60; # 25 minutes. while(1) { sleep(1); print "Hello Perl\n"; } alarm 0; }; alarm 0; if($@) { print "Error: $@\n"; } exit(0);

Replies are listed 'Best First'.
Re^2: CountDownTimer for my perl program,
by MidLifeXis (Monsignor) on Feb 22, 2013 at 13:52 UTC

    See the warning about using sleep and alarm being used in tandem.


Re^2: CountDownTimer for my perl program,
by vinoth.ree (Monsignor) on Feb 25, 2013 at 04:46 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1020089]
[Corion]: :) I had to reconnect my DVD drive to actually burn the CD-R - I think I last spun it up three years ago or something...
Discipulus must burn phot cd to send to mother in law..
[Corion]: I wonder, maybe the time is right to offer a CD burn service - you send the files, I burn them onto CD-R and mail it to whoever you specified. A printed CD costs extra ;)
[Corion]: Just because there are things that you can't do/share via Facebook. Or even better, you mail me the iPhoto / Facebook page and I create and mail a Photo CD from them ;)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2017-11-20 18:45 GMT
Find Nodes?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:

    Results (291 votes). Check out past polls.