in reply to Error trapping

I wonder if you could tie something to $!. Although I suspect the magic nature of $! would get in the way, since I doubt that the tied function would be called when $! got set. But it was a thought.