Skip Menu |

This queue is for tickets about the Tie-File CPAN distribution.

Report information
The Basics
Id: 3221
Status: resolved
Worked: 2 min
Priority: 0/
Queue: Tie-File

People
Owner: Nobody in particular
Requestors: jari.aalto [...] poboxes.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.93
Fixed in: (no value)



Subject: 0.93 untie attempted while 1 inner references still exist
root@w2kpicasso:~/tmp# perl -MTie::File -e 'print $Tie::File::VERSION . qq(\n)' 0.93 Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration: Platform: osname=cygwin, osvers=1.3.22(0.7832), archname=cygwin-multi-64int uname='cygwin_nt-4.0 iokaste 1.3.22(0.7832) 2003-03-18 09:20 i686 unknown unknown cygwin ' I'm using function local variables. Please check if there is abvious error in my code or if there is a possible problem in Tie::File. The generated tie-file.txt looks ok, but code generates Error message: untie attempted while 1 inner references still exist at /home/jaalto/tmp/tie-file.pl line 50, <FH> line 12. Code reads like this below (also in attachement without line numbers) Jari 1 #!/bin/perl 2 3 use strict; 4 use English; 5 6 my $LIB = "tie-file.pl"; 7 8 IMPORT: 9 { 10 use Env; 11 12 use vars qw 13 ( 14 $HOME 15 ); 16 17 die "HOME not set" unless $HOME; 18 } 19 20 21 22 23 24 # CPAN module, pure perl solution. Better than DB_File 25 use Tie::File; 26 27 28 sub Main () 29 { 30 my $id = "$LIB.Main"; 31 32 my $dir = "$HOME/tmp"; 33 die "No dir $dir" unless -d $dir; 34 35 my $file = $dir . "/tie-file.txt"; 36 my @list; 37 38 my $obj = tie @list, 'Tie::File', $file 39 or die "$id: Cannot Tie $file $ERRNO"; 40 41 # Clear file 42 43 $#list = 0; 44 45 for my $i ( 0 .. 10 ) 46 { 47 $list[ $i ] = "Line $i"; 48 } 49 50 untie @list; 51 } 52 53 Main(); 54 55 # End of file
#!/bin/perl use strict; use English; my $LIB = "tie-file.pl"; IMPORT: { use Env; use vars qw ( $HOME ); die "HOME not set" unless $HOME; } # CPAN module, pure perl solution. Better than DB_File use Tie::File; sub Main () { my $id = "$LIB.Main"; my $dir = "$HOME/tmp"; die "No dir $dir" unless -d $dir; my $file = $dir . "/tie-file.txt"; my @list; my $obj = tie @list, 'Tie::File', $file or die "$id: Cannot Tie $file $ERRNO"; # Clear file $#list = 0; for my $i ( 0 .. 10 ) { $list[ $i ] = "Line $i"; } untie @list; } Main(); # End of file
To: bug-Tie-File [...] rt.cpan.org
Subject: Re: [cpan #3221] 0.93 untie attempted while 1 inner references still exist
Date: Tue, 12 Aug 2003 14:54:28 -0400
From: Mark Jason Dominus <mjd [...] plover.com>
RT-Send-Cc:
Show quoted text
> I'm using function local variables. Please check if there is abvious > error in my code
There's an obvious error in your code. You're calling 'untie', but you're still holding a reference to the tied object, in $obj, so the object can't be destroyed. To avoid the warning, you need to undef $obj before calling 'untie'. Thanks for your report.