in reply to Re: How to detect a die() without catching it?
in thread How to detect a die() without catching it?

The problem is that when that die() gets printed it will say "at Devel::Profiler, line X" instead of the real source of the die().

-sam

  • Comment on Re: Re: How to detect a die() without catching it?

Replies are listed 'Best First'.
Re: Re: Re: How to detect a die() without catching it?
by educated_foo (Vicar) on May 18, 2002 at 00:04 UTC
    For this part, you can just add a "\n" to the end of the message, right? e.g.
    sub blah { die "blah"; } eval {blah();}; if ($@) { die "$@\n"; } else { print "okay\n"; } # prints "blah at foo.pl line 4"
    /s
      We have a winner! This will produce exactly the behavior I'm looking for without requiring an explicit stack and nasty %SIG hackery. Thanks!

      -sam