in reply to Why no $@ after eval? Bug?

Looking at the code in your followup, I'd expect this is down to the use of local $@ just before the eval in _rmap() - if the eval fails, you die $@, which puts the error message in $@, which is then overwritten when the original $@ is restored on unwinding.

I'd suggest it should instead do something like (untested):

my $error; my @got; { local $@; @got = eval { $self->call(); }; if ($@) { if (ref($@) && $@ == $cut) { push @return, @$cut; next; } else { $error = $@; } } } die $error if $error; push @return, @got;

Hugo

Replies are listed 'Best First'.
Re: Re: Why no $@ after eval? Bug?
by bsb (Priest) on May 08, 2004 at 03:20 UTC
    That's it. Thanks