Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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.

Alexander

-- 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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2019-09-23 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The room is dark, and your next move is ...












    Results (276 votes). Check out past polls.

    Notices?