in reply to missing soap:fault when using eval{}

I've tested my code again and it seems I have this problem:

http://search.cpan.org/~elliotjs/Perl-Critic-1.106/lib/Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm

I do have DESTROY which is always called and calls DBIx::Log4perl::db::disconnect indirectly while disocnnecting from the database. In this function eval is used successfully, which resets $@ and SOAP-Lite can't detect the former die anymore, which let the code stop because of an error.

What I don't understand is, if I do a eval{} myself to catch the exception and save $@ in a variable, $@ doesn't seem to be reset. If I die directly in that eval again, no matter if I die with $@ or something else, SOAP-Lite sends an empty response again.

Won't work:

eval { someClass->new()->someMethod(); } or die 'test';

Does work:

my $retVal = undef; eval { someClass->new()->someMethod(); } or $retVal = SOAP::Fault->new(faultstring => $@); die $retVal;

$retVal will have the proper message from $@ from the die in someMethod. I would have expected that $@ is always cleared because of DESTROY is always called in the eval above.