in reply to 5.10 shows uninitialized $@ warning

I can't reproduce the behaviour. I tried:
use warnings; eval { local $SIG{'__DIE__'} = sub { die $@ }; print 1 / 0; };
On 5.10 (AS and Strawberry) that script runs without output. On perl 5.8.8 it outputs Illegal division by zero at try.pl line 4. for me.

Cheers,
Rob

Replies are listed 'Best First'.
Re^2: 5.10 shows uninitialized $@ warning
by ikegami (Patriarch) on May 16, 2008 at 14:35 UTC
    Bad example. 1/0 produces a compile-time exception in 5.8. Once you fix that, both behave identically and contrary to the OP's results.
    use warnings; my $denum = 0; eval { local $SIG{'__DIE__'} = sub { die $@ }; print 1 / $denum; }; print "[$@]\n";
    >c:\progs\perl588\bin\perl script.pl [Died at script.pl line 4. ] >c:\progs\perl5100\bin\perl script.pl [Died at script.pl line 4. ]
    This is perl, v5.8.8 built for MSWin32-x86-multi-thread Binary build 817 [257965] provided by ActiveState http://www.ActiveSta +te.com This is perl, v5.10.0 built for MSWin32-x86-multi-thread Binary build 1001 [283495] provided by ActiveState http://www.ActiveSt +ate.com
      Bad example

      It was a perfectly fine example (in terms of the op's original conditions ;-)

      Cheers,
      Rob

        Your code never gets to execute the eval, much less to using $@ afterwards, so you couldn't possibly get the a warning from using $@. That's like saying "I can't replicate the fact that you got 'foo' on the screen, but ignore the fact that I didn't actually call a print function."

Re^2: 5.10 shows uninitialized $@ warning
by pmSwim (Acolyte) on May 16, 2008 at 14:55 UTC
    I checked your snippet with same results like you. So I'm now more unillumined as before my post. I played a little bit with your code and find that there must be a local $@ in the code hierarchy. I'm relative sure that is not explicit set inside of my code. Maybe in a module I use but I do not understand why it is localized. Can someone please give me a hint how to find the place where $@ is maybe localized. Thanks in advance.