CARVIEW |
Select Language
HTTP/2 200
cache-control: max-age=43200
server: Combust/Plack (Perl)
vary: Accept-Encoding
content-encoding: gzip
content-length: 2937
content-type: text/html; charset=utf-8
last-modified: Sat, 11 Oct 2025 21:37:40 GMT
date: Sat, 11 Oct 2025 21:37:40 GMT
strict-transport-security: max-age=15768000
RE: my $@ - a proposal - nntp.perl.org
Front page | perl.perl5.porters |
Postings from June 2008
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About

RE: my $@ - a proposal
Thread Previous | Thread NextFrom:
Jan DuboisDate:
June 27, 2008 13:35Subject:
RE: my $@ - a proposalMessage ID:
043e01c8d895$575f01b0$061d0510$@comOn Fri, 27 Jun 2008, Graham Barr wrote: > On Jun 27, 2008, at 2:39 PM, Jan Dubois wrote: >> That's not really good enough though. You need to restore ERRSV >> whenever the initial substring of the saved ERRSV doesn't match the >> current ERRSV (making sure that only cleanup errors have been >> appended). > > You cannot do that. Where does it say that $@ is a string? In that case you can restore it unconditionally and throw all the (in cleanup) messages away. Right now calling die() inside DESTROY will reset $@ to "" if it is not SvPOK(). Otherwise it could not append the "\t(in cleanup)" message. So error objects right now don't survive calls to die() inside DESTROY at all. >> Otherwise you still end up with the wrong value in $@ when DESTROY >> (or any code called from it) uses an eval that catches a die(): >> >> sub foo::DESTROY { eval {require bar} } >> eval { my $foo = bless [] => "foo"; die "I'm dead\n" }; >> print "\$\@ is $@\n"; >> >> With your patch you at least end up with a TRUE value in $@, but the >> actual content is still not what you would expect. > > What do you expect ? I expect the code to print $@ is I'm dead regardless if DESTROY is any of these three: 1) sub foo::DESTROY { } 2) sub foo::DESTROY { eval {} } 3) sub foo::DESTROY { eval {require bar} } Currently it does this only for 1), and the proposed patch only fixes 2) but not 3) (assuming bar.pm cannot be loaded and %bar:: doesn't exist). There is no reason for 3) to overwrite $@ because the exception has already been caught and handled. Cheers, -JanThread Previous | Thread Next
- my $@ - a proposal by Yuval Kogman
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by David Nicol
- Re: my $@ - a proposal by Graham Barr
- Re: my $@ - a proposal by David Nicol
- Re: my $@ - a proposal by Mark Mielke
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by Graham Barr
- Re: my $@ - a proposal by Graham Barr
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by Ben Morrow
- Re: my $@ - a proposal by Graham Barr
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by David Nicol
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by David Nicol
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by David Golden
- Re: my $@ - a proposal by Johan Vromans
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by Rafael Garcia-Suarez
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by Ben Morrow
- Re: my $@ - a proposal by Elliot Shank
- Re: my $@ - a proposal by Abigail
- Re: my $@ - a proposal by Juerd Waalboer
- Re: my $@ - a proposal by David Golden
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by David Golden
- Re: my $@ - a proposal by Graham Barr
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by Graham Barr
- Re: my $@ - a proposal by Sam Vilain
- Re: my $@ - a proposal by David Nicol
- Re: my $@ - a proposal by David Golden
- Re: my $@ - a proposal by Graham Barr
- Re: my $@ - a proposal by David Nicol
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by Aristotle Pagaltzis
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by Raphael_Manfredi
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by Raphael_Manfredi
- Re: my $@ - a proposal by Abigail
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by David Golden
- Re: my $@ - a proposal by Raphael_Manfredi
- Re: my $@ - a proposal by Dr.Ruud
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by Sam Vilain
- Re: my $@ - a proposal by Abigail
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by Sean O'Rourke
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by Steffen Mueller
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by David Golden
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by David Golden
- Re: my $@ - a proposal by Abigail
- Re: my $@ - a proposal by Aristotle Pagaltzis
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by Yuval Kogman
- Re: my $@ - a proposal by Dr.Ruud
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by Sam Vilain
- Re: my $@ - a proposal by David Cantrell
- Re: my $@ - a proposal by Sam Vilain
- Re: my $@ - a proposal by Moritz Lenz
- Re: my $@ - a proposal by Sam Vilain
- Re: my $@ - a proposal by Moritz Lenz
- Re: my $@ - a proposal by Sam Vilain
- Re: my $@ - a proposal by Moritz Lenz
- Re: my $@ - a proposal by Sam Vilain
- Re: my $@ - a proposal by Abigail
- Re: my $@ - a proposal by Mark Mielke
- Re: my $@ - a proposal by Aristotle Pagaltzis
- Re: my $@ - a proposal by David Nicol
- Re: my $@ - a proposal by Nicholas Clark
- Re: my $@ - a proposal by David Nicol
- RE: my $@ - a proposal by Jan Dubois
- Re: my $@ - a proposal by David Nicol
- Re: my $@ - a proposal by Reini Urban
- Re: my $@ - a proposal by Dr.Ruud
- Re: my $@ - a proposal by Sam Vilain
nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About