Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Color die and warn messages

by Anonymous Monk
on Sep 16, 2024 at 16:44 UTC ( [id://11161775]=note: print w/replies, xml ) Need Help??


in reply to Re: Color die and warn messages
in thread Color die and warn messages

Your quote is incomplete: "it replaces our die and warn sighandlers". The point of the code is to be drop-in and not require any other changes in your code. In fact, it would be better to call it in an eval so if it's not installed, it doesn't break anything: BEGIN { eval 'use warnings::colored' };.

Changing die to dye would require you to change any code that uses it, and also it wouldn't then work on anything that internally called die or warn, like the example: system 'nonexistent-command'.

If the %SIG entries could be tied variables, then it might be possible to make this play nice with Carp::Always. I haven't looked into that because it works fine enough as it is for me. That's why I released it anonymously and not to CPAN. If somebody wants to improve on it and deal with the edge cases, feel free to release it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2025-01-16 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (53 votes). Check out past polls.