New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DESTROY silences failures #8336
Comments
From stas@stason.orgCreated by stas@localhost.mailchannels.comThe problem: DESTROY silences any errors, consider: perl -le '$y = 0; $x = 5; $z = $x/$y;' Now the same in DESTROY: perl -le ' package A; sub new { bless \{}, "A"}; my $a = A->new; sub That's nasty especially if you run an essential clean up code in it. Indeed, you get the message if you enable 'warnings': perl -le 'use warnings; package A; sub new { bless \{}, "A"}; my $a = I remember something about perl trying not die in DESTROY, but I can't see Moreover, if you have FATAL enabled, you get no warning/error whatsoever. perl -le 'use warnings FATAL => 'all'; package A; sub new { bless \{}, Perl Info
|
From @doyThis is working as intended. Consider: eval { my $obj = Thinger->new; $obj->do_something_important } If do_something_important dies, you probably want to see that exception. If nobody objects, I will close this ticket in a few days. |
The RT System itself - Status changed from 'new' to 'open' |
From @dcollinsnWorking as intended, no objections to Jesse's suggestion to close. Rejected. |
@dcollinsn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#38513 (status was 'rejected')
Searchable as RT38513$
The text was updated successfully, but these errors were encountered: