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

Answer: How do I trap $SIG{INT} ( sigint aka Ctrl^c )?

( #238807=categorized answer: print w/ replies, xml ) Need Help??

Q&A > programs and processes > How do I trap $SIG{INT} ( sigint aka Ctrl^c )? contributed by Anonymous Monk

Instead of killing yourself, as suggested by crazyinsomniac, you could also try just exiting. This avoids the shell's response of 'aborted' when the program is killed. I.e.:

sub myhand
{
  print "\n caught $SIG{INT}",@_,"\n";
  exit(0);
}

-Josh O-

Comment on Answer: How do I trap $SIG{INT} ( sigint aka Ctrl^c )?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-07-28 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (196 votes), past polls