Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Do's and Dont's inside a signal handler

by f00li5h (Chaplain)
on Dec 18, 2008 at 13:53 UTC ( #731251=note: print w/ replies, xml ) Need Help??

in reply to Do's and Dont's inside a signal handler

Do as little as possible, the more stuff you do the more chance that things are happening at an inconvieniant time for your application... interrupted syscalls etc

Basically, just set a flag that your application will check and reset next iteration through...

my $running = 1; $SIG{HUP} = sub { $running =0 } while ($running){ do_stuff(); }
the handler only signals the outside that next time through it should stop...

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Comment on Re: Do's and Dont's inside a signal handler
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2015-11-30 20:27 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (782 votes), past polls