Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Temp file handles refcount bug?

by ikegami (Pope)
on Mar 14, 2011 at 20:39 UTC ( #893147=note: print w/replies, xml ) Need Help??


in reply to Temp file handles refcount bug?

I get the error on 5.12.2 and 5.12.3. Didn't checking blead. The scalar in question is this one

$fh = IV(0x933914c) at 0x9339150 REFCNT = 1 FLAGS = (PADMY,ROK) RV = 0x938abe8 SV = PVGV(0x9361de8) at 0x938abe8 <-------- REFCNT = 3 FLAGS = () NAME = "$fh" NAMELEN = 3 GvSTASH = 0x924ce18 "File::Temp" GP = 0x923d880 SV = 0x0 REFCNT = 1 IO = 0x922ae48 FORM = 0x0 AV = 0x0 HV = 0x0 CV = 0x0 CVGEN = 0x0 LINE = 513 FILE = "/home/eric/usr/perlbrew/perls/perl-5.12.2/lib/5.12.2/Fil +e/Temp.pm" FLAGS = 0x0 EGV = 0x938abe8 "$fh"

Destroying the tied handle before global destruction appears to avoid the problem.

{ my $fhWrapper = Symbol::gensym; tie(local *$fhWrapper, 'MyWrapper', $fhWrapper, $fh); ... }

Replies are listed 'Best First'.
Re^2: Temp file handles refcount bug?
by ELISHEVA (Prior) on Mar 14, 2011 at 20:55 UTC

    That doesn't work on my machine, but deselecting the tied handle does silence the complaint, e.g. making the last line select STDOUT or some such.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://893147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2021-10-22 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?