undef $@; my @val = eval { do_stuff() }; if ($@) { if (ref $@ and $@->isa('SoftError')) { warn ${$@}; # SoftError object is a scalar ref with the message return } else { die $@ # as if we had never caught it } } push @rv, @val;