in reply to lexical variables and signal handlers
The answer, for perls before 5.8.0, is you don't and you shouldn't. The signal handler code you use is not interrupt safe, and will sometimes core perl if you use it. Things are better with 5.8.0, though if you build with unsafe signals you'll still have that problem.