From: "Todd A. Jacobs" Date: 2007-09-22T08:04:08+09:00 Subject: Break loop by trapping INT I'm trying to break a loop whenever CTRL-C is pressed, and find that this doesn't work: trap 'INT', proc {break}; count=0; while count < 10; puts count += 1; sleep 1; end I'm guessing it's because the loop is somehow out of scope, but I'm not sure why. Some minor syntax changes to trap makes it work, sort of. If I use: trap('INT') {break} instead, then I get a LocalJumpError. So, why does the syntax only work one way, and what is the right way to trap the interrupt? -- "Oh, look: rocks!" -- Doctor Who, "Destiny of the Daleks"