From: Jarkko Hietaniemi Date: Tue, 13 May 2003 11:22:06 +0000 (+0000) Subject: Revert #19498 since it broke threaded builds. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0ca4ce0d843a0dcf48769457f5c67ca9b976899a;p=p5sagit%2Fp5-mst-13.2.git Revert #19498 since it broke threaded builds. p4raw-id: //depot/perl@19508 --- diff --git a/lib/Tie/File.pm b/lib/Tie/File.pm index 26014dd..a478688 100644 --- a/lib/Tie/File.pm +++ b/lib/Tie/File.pm @@ -97,7 +97,6 @@ sub TIEARRAY { $fh = \do { local *FH }; # only works in 5.005 and later sysopen $fh, $file, $opts{mode}, 0666 or return; binmode $fh; - ++$opts{ourfh}; } { my $ofh = select $fh; $| = 1; select $ofh } # autoflush on write if (defined $opts{discipline} && $] >= 5.006) { @@ -408,10 +407,6 @@ sub DESTROY { my $self = shift; $self->flush if $self->_is_deferring; $self->{cache}->delink if defined $self->{cache}; # break circular link - if ($self->{fh} and $self->{ourfh}) { - delete $self->{ourfh}; - close delete $self->{fh}; - } } sub _splice { @@ -2294,11 +2289,6 @@ means no pipes or sockets. If C can detect that you supplied a non-seekable handle, the C call will throw an exception. (On Unix systems, it can detect this.) -Note that Tie::File will only close any filehandles that it opened -internally. If you passed it a filehandle as above, you "own" the -filehandle, and are responsible for closing it after you have untied -the @array. - =head1 Deferred Writing (This is an advanced feature. Skip this section on first reading.)