From: Wilson, Doug Date: Fri, 12 Oct 2001 11:51:05 +0000 (-0700) Subject: RE: [PATCH File::Copy] Silence warnings for tied filehandles X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=025a6ea34d1db43cc0ba155e47d26d92ef6726ef;p=p5sagit%2Fp5-mst-13.2.git RE: [PATCH File::Copy] Silence warnings for tied filehandles Message-ID: <35A280DF784CD411A06B0008C7B130AD0115DDAE@sdex04.sd.intuit.com> p4raw-id: //depot/perl@12419 --- diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index afb7635..be184a6 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -128,8 +128,7 @@ sub copy { $size = shift(@_) + 0; croak("Bad buffer size for copy: $size\n") unless ($size > 0); } else { - no warnings 'uninitialized'; - $size = -s $from_h; + $size = tied(*$from_h) ? 0 : -s $from_h || 0; $size = 1024 if ($size < 512); $size = $Too_Big if ($size > $Too_Big); }