in reply to trap signal 'exit': why I am not able to have it work??
A google search for "perl signal handler exit" gave this SOPM node, and the first answer also says use END{}.
http://www.perlmonks.org/?node_id=849549
Of course, going to the next level, you can't switch "exit" handlers midstream, and you can't unregister END{} blocks, AFAIK. I suppose there would have to be only one END{} block, with a dynamic call table for subs, and the call table gets changed as needed during the program execution. (Maybe this is proper class material, with methods to mangle the call table.)
-QM
--
Quantum Mechanics: The dreams stuff is made of
In Section
Seekers of Perl Wisdom