in reply to How to enrich error-messages?

Instead of running
perl script.pl ...
run something like
perl -e' $SIG{__WARN__} = sub { local ( $/, $,, $! ); print STDERR "(W) ", @_, "\n"; }; do shift(@ARGV) or die("(F) $@"); ' script.pl ...

Replies are listed 'Best First'.
Re^2: Howto enrich errormessages
by LanX (Saint) on Oct 14, 2009 at 21:55 UTC
    Thanks Ike!

    $SIG{__WARN__} was the jigsaw piece I was looking for, though your code doesn't work and I'm not sure if you really meant a void if clause.

    Anyway I think the best approach is to extend or subclass diagnostics in a wayto support a "Terse" option. That must be stable.

    Thx! 8)

    Cheers Rolf

        > Fixed.

        not yet. Fatals are not reported... :)

        > By the way, diagnostics uses $SIG{__WARN__} too

        I know, but it has some functionality. I'd like to add a reference to the according diagnostic, which can be displayed in emacs after clicking.

        Cheers Rolf