From: Rafael Garcia-Suarez Date: Fri, 31 Mar 2006 08:00:08 +0000 (+0000) Subject: Test for fileno definedness instead of truth X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=414ef3ea9175fb97702b64f7bf165596a34444d7;p=p5sagit%2Fp5-mst-13.2.git Test for fileno definedness instead of truth Don't load Config.pm, which isn't used p4raw-id: //depot/perl@27639 --- diff --git a/lib/FileCache.pm b/lib/FileCache.pm index 02bde7e..285307f 100644 --- a/lib/FileCache.pm +++ b/lib/FileCache.pm @@ -1,6 +1,6 @@ package FileCache; -our $VERSION = '1.06'; +our $VERSION = '1.07'; =head1 NAME @@ -80,7 +80,6 @@ so you may have to set I yourself. require 5.006; use Carp; -use Config; use strict; no strict 'refs'; @@ -137,7 +136,7 @@ sub cacheout_open { sub cacheout_close { # Short-circuit in case the filehandle disappeared my $pkg = caller($_[1]||0); - fileno(*{$pkg . '::' . $_[0]}) && + defined fileno(*{$pkg . '::' . $_[0]}) && CORE::close(*{$pkg . '::' . $_[0]}); delete $isopen{$_[0]}; }