in reply to Re: Why isn't a fatal error trappable?
in thread Why isn't a fatal error trappable?

I mean I have an error handler that normally traps errors, but it's not catching this one....

(ie...using SIG{DIE} & SIG{WARN}...)

For that matter, in this case, how do I test if a value is writable before writing to it?

In this case the error is the result of attempting to assign to a variable that is declared as the result of being "aliased" to a 'stack' variable. I'm not sure how it would ever end up being 'readonly' -- undefined, MAYBE, but readonly??

don't see how off hand...

  • Comment on Re^2: Why isn't a fatal error trappable?

Replies are listed 'Best First'.
Re^3: Why isn't a fatal error trappable?
by choroba (Cardinal) on Nov 16, 2010 at 12:15 UTC
    I can trap the error with a handler, too:
    $ perl -e '$SIG{__DIE__} = sub {die "Handled: @_"};undef=1' Handled: Modification of a read-only value attempted at -e line 1.
Re^3: Why isn't a fatal error trappable?
by derby (Abbot) on Nov 16, 2010 at 11:52 UTC

    Should that be __DIE__ and __WARN__ ?

    -derby
    A reply falls below the community's threshold of quality. You may see it by logging in.