Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 browsing the Monastery: (3)
As of 2020-02-24 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (104 votes). Check out past polls.

    Notices?