New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning on nonexistent bareword filehandle #16561
Comments
From @epaCreated 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 Perl Info
|
From @epaSorry, of course it does warn if 'use warnings' is on. I do still think a compile-time, rather than run-time diagnostic would be superior. |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn 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' -- |
From @epaMy 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? |
From @epaAlso, please note the oddity that if the bareword happens to begin with an underscore, no compile-time warning is given: % perl -wcE 'use strict; print _FOO 55' Is there a reason for this special treatment? |
From @iabynOn 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 -- |
Migrated from rt.perl.org#133210 (status was 'open')
Searchable as RT133210$
The text was updated successfully, but these errors were encountered: