in reply to Color die and warn messages

Doesn't work with Carp. croak calls CORE::die internally so the coloring would need to be done in the die handler, and carp is colored red even though internally it doesn't call CORE::warn, but somehow the CORE::GLOBAL::warn override is bypassed.

Replies are listed 'Best First'.
Re^2: Color die and warn messages
by sleet (Monk) on Sep 04, 2025 at 07:01 UTC
    Carp overrides the die handler so that won't work. What about using a tied handle to STDERR: Perl Programming 4.4. Tying Filehandles. But I don't think it would be possible to distinguish fatal messages.