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
binmode clobbers $@ under certain circumstances #10800
Comments
From muir@arubanetworks.comCreated by muir@arubanetworks.comThis is a bug report for perl from muir@arubanetworks.com, ----------------------------------------------------------------- binmode() can clobber $@ under certain circumstances. This reproduces it: $@ = 'foo'; open(my $fh, '>/tmp/foo'); warn $@; Note that setting the binmode to ':raw' does not clobber $@. If this turns out to not be a bug for some reason, the perldoc for binmode In case you are curious, the first symptom I saw was die() being unusually Perl Info
|
The RT System itself - Status changed from 'new' to 'open' |
From zefram@fysh.orgmuir@arubanetworks.com wrote:
Any place that you call into arbitrarily complex code can clobber $@,
In Perl 5.13 we have made a change so that a DESTROY method clobbering $@ In any case, for a DESTROY method to clobber $@ or other status variables local( This will avoid your problem on the Perl that you are using, and avoid -zefram |
From @druud62On 2010-11-05 22:59, muir @ arubanetworks . com wrote:
No bug. A quality of global variables is, well ... that they are global. Decent Perl pattern: my $result; eval { To preserve $@ you can localize it in your DESTROY. See also Try::Tiny and friends. -- |
From @xdgOn Sat, Nov 6, 2010 at 8:03 AM, Zefram <zefram@fysh.org> wrote:
That's true, but it's not immediately obvious to a non-expert how (Though I agree with other comments that it's best practice to -- David |
From @cpansproutFixed in 523a494. |
@cpansprout - Status changed from 'open' to 'resolved' |
From @janduboisOn Sat, 06 Nov 2010, David Golden wrote:
It is also not obvious to non-experts how arbitrarily complex even the I would like to register _some_ protest against adding gratuitous cruft Cheers, |
From @xdgOn Sat, Nov 6, 2010 at 10:29 PM, Jan Dubois <jand@activestate.com> wrote:
Yes, but tying and overloading is usually done by the user, whereas a
I understand the sentiment, entirely. I still hope someday for -- David |
Migrated from rt.perl.org#78844 (status was 'resolved')
Searchable as RT78844$
The text was updated successfully, but these errors were encountered: