[Pkg-perl-maintainers] [Bug 1086527] [NEW] Some false positives
gregor herrmann
gregor+debian at comodo.priv.at
Tue Dec 4 20:16:48 UTC 2012
On Tue, 04 Dec 2012 19:25:08 -0000, Pierre Rudloff wrote:
> With this file:
> https://svn.strasweb.fr/dl.php?repname=Pierre+Rudloff&path=%2Fperl%2FLatexRudloff.pl&rev=46
> I get some false positives:
> pierre at pierre-MacBook:/var/www/svn-rudloff/perl$ perlcritic --brutal LatexRudloff.pl
> Close filehandles as soon as possible after opening them at line 16, column 8. See page 209 of PBP. (Severity: 4)
> File handle for "print" or "printf" is not braced at line 37, column 17. See page 217 of PBP. (Severity: 1)
>
> I can't close the file handle sooner or it won't work.
> And $space is not a file handle so it does not need to be braced.
I just tried to run
% perlcritic --brutal --verbose 11 LatexRudloff.pl
to get more info.
As for the first issue, the diagnostic output says:
This policy takes note of calls to `open()' where there is no matching
`close()' call within `N' lines of code. If you really need to do a lot
of processing on an open filehandle, then you can move that processing
to another method like this: [..]
For the second one, `perldoc -f print' is interesting:
(NOTE: If
FILEHANDLE is a variable and the next token is a term, it may be misinterpreted as an operator unless you
interpose a "+" or put parentheses around the arguments.)
What seems to work is
print +( $space
. $space
. $numsec . q{.}
. $numsubsec . q{.}
. $numsubsubsec
. $dot
. $1 . "\n" )
or carp;
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key 0xBB3A68018649AA06
: :' : Debian GNU/Linux user, admin, and developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of the Free Software Foundation Europe
`- NP: Die Schmetterlinge: Hände über Hönnepel
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to libperl-critic-perl in Ubuntu.
https://bugs.launchpad.net/bugs/1086527
Title:
Some false positives
Status in “libperl-critic-perl” package in Ubuntu:
New
Bug description:
With this file:
https://svn.strasweb.fr/dl.php?repname=Pierre+Rudloff&path=%2Fperl%2FLatexRudloff.pl&rev=46
I get some false positives:
pierre at pierre-MacBook:/var/www/svn-rudloff/perl$ perlcritic --brutal LatexRudloff.pl
Close filehandles as soon as possible after opening them at line 16, column 8. See page 209 of PBP. (Severity: 4)
File handle for "print" or "printf" is not braced at line 37, column 17. See page 217 of PBP. (Severity: 1)
I can't close the file handle sooner or it won't work.
And $space is not a file handle so it does not need to be braced.
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: libperl-critic-perl 1.117-2
ProcVersionSignature: Ubuntu 3.5.0-19.30-generic 3.5.7
Uname: Linux 3.5.0-19-generic i686
ApportVersion: 2.6.1-0ubuntu6
Architecture: i386
Date: Tue Dec 4 20:21:41 2012
MarkForUpload: True
PackageArchitecture: all
SourcePackage: libperl-critic-perl
UpgradeStatus: Upgraded to quantal on 2012-10-25 (40 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libperl-critic-perl/+bug/1086527/+subscriptions
More information about the foundations-bugs
mailing list