On Tue, Sep 01, 2015 at 11:26:27AM -0400, Robert Haas wrote:
> On Tue, Sep 1, 2015 at 9:58 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
> > On 08/31/2015 11:57 PM, Peter Eisentraut wrote:
> >> We now have 80+ Perl files in our tree, and it's growing. Some of those
> >> files were originally written for Perl 4, and the coding styles and
> >> quality are quite, uh, divergent. So I figured it's time to clean up
> >> that code a bit. I ran perlcritic over the tree and cleaned up all the
> >> warnings at level 5 (the default, least severe).
> >
> > I don't object to this. Forcing strict mode is good, and I think I stopped
> > using bareword file handles around 17 years ago.
>
> FWIW, I think perlcritic is both useless and annoying. I've always
> used bareword file handles, and I don't really see what the problem
> with it is, especially in very short script files.
A bareword file handle is a form of global variable, so the criticism is
helpful for codebases large enough to make those a maintenance problem. It's
important for any CPAN module, so I can understand perlcritic including it.
Plenty of uses in our tree are fine.
> And what's wrong
> with two-argument form of open, if the path is a constant rather than
> possibly-tainted user input? Perl advertises that TMTOWTDI, and then
> perlcritic complains about which one you picked, mostly AFAICS for no
> particularly compelling reason. So I'm pretty meh about this whole
> exercise, especially if we follow it up by cleaning up the lower
> levels of warnings which, from what I can see, are unnecessary
> pedantry on top of unnecessary pedantry.
>
> But I suspect I'm in the minority here, so feel free to ignore me. (I
> certainly do agree that use strict and use warnings are a good thing
> to use everywhere. It's just perlcritic I dislike.)
I agree with the rest of your message.