Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^3: Have $SIG{INT} ask if user wants to quit

by afoken (Canon)
on Mar 11, 2009 at 15:25 UTC ( #749915=note: print w/replies, xml ) Need Help??

in reply to Re^2: Have $SIG{INT} ask if user wants to quit
in thread Have $SIG{INT} ask if user wants to quit

You do quite a lot of work (calling some arbitary external program, writing to the current default handle, and reading STDIN) inside a signal handler. This will surely bite you with any old perl (before 5.7.3), and I won't bet that newer perls will have no problems. Don't put much work into signal handlers, just set a flag and handle it in the main loop -- or just exit() or die() immediately. See also Signals.


-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re^3: Have $SIG{INT} ask if user wants to quit

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2020-10-01 01:50 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (172 votes). Check out past polls.