Bug#271509: perl fails to warn about incorrect filehandle usage

Niko Tyni ntyni at debian.org
Sun Apr 3 20:34:40 UTC 2016


On Mon, Sep 27, 2004 at 05:49:19PM +1000, Brendan O'Dea wrote:
> On Mon, Sep 13, 2004 at 11:54:34PM +1000, Anand Kumria wrote:
> >I was mucking about playing with filehandles and discovered that in a.pl
> >the output is incorrect whereas perl warns me about bad usage in b.pl
> 
> [a.pl] print $bar, "q\n";
> [b.pl] print BAR, "q\n";
> 
> >They do, in essence, the same thing.
> 
> The difference is that the syntax in b.pl is unambiguously incorrect,
> hence may be (and is) detected at compile-time as an error.  By
> comparison, the syntax of a.pl is perfectly legal--consider:
> 
>   $bar = "hello, world";
>   print $bar, "\n";

I'm not sure if this old bug should be kept open as a request for a
runtime warning when printing out a stringified file handle, or just
closed as a non-bug. Opinions?
-- 
Niko Tyni   ntyni at debian.org




More information about the Perl-maintainers mailing list