Warning on nonexistent bareword filehandle #16561
Created by @epa
% perl -E 'use strict; print FOO 55'
This prints nothing. I think it should warn.
% perl -E 'use strict; print FOO'
That should warn too.
Personally I would go further and say that the second example should
(In general a compile-time way to turn off bareword filehandles, apart
On Thu, May 17, 2018 at 06:00:37AM -0700, Ed Avis via RT wrote:
It already is a compile-time diagnostic:
$ perl -wce 'use strict; print FOO 55'
My bad, for some reason I forgot that -w enables both run-time and compile-time warnings.
I was thinking that the compile-time check would have to fall under 'use strict', since that's the thing that turns off barewords generally, so it might deal with bareword filehandles too.
Any chance of a 'use strict' variant to turn off bareword filehandles in the same way as other barewords?
On Fri, May 18, 2018 at 01:30:35AM -0700, Ed Avis via RT wrote:
It applies to all vars starting with underscore, e.g.
$ perl -we'$foo=$_bar'
but I can't see it documented (although I didn't look further than the