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
readline(FH) throws a warning, <FH> does not #15850
Comments
From ryan.royal@airbus.comA bare word file handle causes the readline(FH) function to emit a warning: Name "main::FH" used only once: possible typo at readline_test.pl line 4. -The equivalent diamond operator <FH> used on the same bare word handle does not evoke the warning. -Using a lexically scoped file handle with readline( $fh ) also does not evoke the warning. See attached, thanks ========================== version =========================== C:\Home\RRoyal02\MyPrograms\perl\bin> perl5.24.0 -v This is perl 5, version 24, subversion 0 (v5.24.0) built for MSWin32-x64-multi-thread Copyright 1987-2016, Larry Wall =========================== OS ============================ The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised. |
From ryan.royal@airbus.comScanMail detected and removed a file named "readline_bug.zip" that violated attachment blocking policy from the original mail entity. You can safely save or delete this replacement attachment. |
From @iabynOn Mon, Jan 30, 2017 at 08:44:36AM -0800, ROYAL@rt.perl.org wrote:
readline takes a typeglob as an argument, while the <> operator takes the $line = <STDIN>; Note that one has a '*', the other doesn't. However, readline will accept So at *compile* time (at which time 'only used once' warnings are checked <FH> is compiled as readline *FH and a typeglob check is done; while readline FH is compiled as readline 'FH' and no typeglob is involved or checked for, Note that 'readline *FH' *will* give a warning. It might be possible to change it so that in 'readline FH', the "FH"
Lexicals don't give 'only used once' warnings in any situation, not just -- |
The RT System itself - Status changed from 'new' to 'open' |
@iabyn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#130673 (status was 'rejected')
Searchable as RT130673$
The text was updated successfully, but these errors were encountered: