Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Which signals are unsafe?

by BrentDax (Hermit)
on Apr 01, 2004 at 23:25 UTC ( #341832=note: print w/replies, xml ) Need Help??


in reply to Which signals are unsafe?

$SIG{__WARN__} isn't a real signal, so it's safe. I believe that all signals have been safe since 5.8.

Have you looked at the Carp module? It can be used with $SIG{__WARN__} to print backtraces. Perhaps you could do something like this:

use Carp 'cluck'; $SIG{__WARN__}=\&cluck; open(STDERR, "|tee -a Warnings.log") or die "Can't open STDERR to tee: + $!";

It's not exactly the same as what you have; most notably, all STDERR output would go to Warnings.log, not just warnings. Fixing this is left as an exercise for the reader. ;^)

If nothing else, Carp's longmess sub can handle the backtracing for you.

=cut
--Brent Dax
There is no sig.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://341832]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2022-01-27 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?