From: Roderick Schertler Date: Wed, 4 Sep 1996 02:55:31 +0000 (+0000) Subject: FileHandle::DESTROY for fd 0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c891ab9c8edfc8e2047084edbe1f65cc4d305b8;p=p5sagit%2Fp5-mst-13.2.git FileHandle::DESTROY for fd 0 This fixes FileHandle::DESTROY when called on stdin. --- diff --git a/ext/FileHandle/FileHandle.pm b/ext/FileHandle/FileHandle.pm index 03a698d..1c030ec 100644 --- a/ext/FileHandle/FileHandle.pm +++ b/ext/FileHandle/FileHandle.pm @@ -270,10 +270,10 @@ sub DESTROY { if ($fh =~ /=FILEHANDLE\(/) { local *TMP = $fh; - close(TMP) if fileno(TMP); + close(TMP) if defined fileno(TMP); } else { - close($fh) if fileno($fh); + close($fh) if defined fileno($fh); } }