develooper Front page | perl.perl5.porters | Postings from October 2018

[perl #126676] File handle doesn't close when out of scope due to\shift

From:
Todd Rinaldo via RT
Date:
October 18, 2018 05:26
Subject:
[perl #126676] File handle doesn't close when out of scope due to\shift
Message ID:
rt-4.0.24-18364-1539627556-1023.126676-15-0@perl.org
On Thu, 19 Nov 2015 09:20:06 -0800, sprout wrote:
> 
> It has been on my ever-growing to-do list for some time to consider
> whether _GEN_NNN should every be added to the stash. Every time that
> happens, it’s a leak. Does anybody ever access them by name?
> 
> Whether this should be fixed by (a) switching everything to __ANONIO__
> or by (b) using _GEN_NNN without adding it to the stash I cannot say.
> I don’t understand why we ended up with an inconsistency in the first
> place. (Digging in history to find out which one came first might shed
> some light on it.) Using _GEN_* does allow different handles to be
> distinguished in error messages, but __ANONIO__ certainly seems
> cleaner.  For backward-compatibility, though, maybe option b is the
> best choice.
> 

FYI,

We're in the process of submitting a change to Perl::Critic to discourage the use of \shift.  https://github.com/Perl-Critic/Perl-Critic/pull/837

At this point we've now got 4 major versions of perl with this issue.



---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=126676



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About