develooper Front page | perl.perl5.porters | Postings from September 2013

[perl #119997] eof($fh) if $fh points to \undef throws a spurious warning

From:
Father Chrysostomos via RT
Date:
September 28, 2013 13:41
Subject:
[perl #119997] eof($fh) if $fh points to \undef throws a spurious warning
Message ID:
rt-3.6.HEAD-31239-1380375656-74.119997-15-0@perl.org
On Tue Sep 24 22:57:33 2013, felipe@cpanel.net wrote:
> 
> This is a bug report for perl from felipe@cpanel.net,
> generated with the help of perlbug 1.39 running under perl 5.14.3.
> 
> 
> -----------------------------------------------------------------
> [Please describe your issue here]
> 
> root@felipe 00:55:40 adminbin_json_caching * /usr/local/cpanel
> > perl -w -Mstrict -E'my $foo; open my $fh, "<", \$foo; say eof $fh'
> Use of uninitialized value $fh in eof at -e line 1.
> 1
> 
> ------
> That pretty well says it: eof($fh) is reporting $fh to be [un]defined when
> it clearly is defined as a filehandle.

This is tricky because report_uninit_var assumes that a unary operator’s
argument must be the SV responsible for the warning.  I don’t see an
easy way to fix it.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=119997



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About