From 414ef3ea9175fb97702b64f7bf165596a34444d7 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 31 Mar 2006 08:00:08 +0000 Subject: Test for fileno definedness instead of truth Don't load Config.pm, which isn't used p4raw-id: //depot/perl@27639 --- lib/FileCache.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/FileCache.pm') diff --git a/lib/FileCache.pm b/lib/FileCache.pm index 02bde7e68f..285307f37d 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]}; } -- cgit v1.2.1