in reply to signal handlers that play nice

You may want to check out Automatic stack tracebacks in warnings? on how I replace a warn handler and place a new warn handler in the "stack" by calling the old warn handler during my warn handler. It's one of the few times where using & to call a function is the right WTDI since I want to transparently pass along all parameters. Now that I'm looking at it, the if modifier probably should also be checking that $oldwarn is a CODE ref...

As for it being temporary - dragonchild's local suggestion is bang on. He just missed the part where you wanted to call the previous warn subroutine from within your own.

Replies are listed 'Best First'.
Re^2: signal handlers that play nice
by aquarium (Curate) on Oct 27, 2005 at 15:01 UTC
    typically you don't want to call any previously assigned routine; unless you are certain that its' code is kosher.
    the hardest line to type correctly is: stty erase ^H
      I'm not seeing the harm here. If you call the previous warn within your warn, you can't make things worst. If the previous warn works, your warn should still work. If it bombs, well the new warn still bombs. Inversely, if you don't call the previous warn, you may make another part of the program malfunction.
Re^2: signal handlers that play nice
by esharris (Monk) on Oct 28, 2005 at 09:16 UTC
    You summed up the situation very well. Thanks!