Re: Stanford IDG internal Perl style
On 2013-04-06 05:23, Russ Allbery wrote:
> Niels Thykier <niels@thykier.net> writes:
>> [...]
>
>> Ah, that makes sense. I just learned that autodie also have an issue with:
>> open(STDERR, '>&', STDOUT);
>
>> (requring the latter bareword to be \*STDOUT to avoid a syntax error).
>> But it still beats having to check every single open/close call, so... :)
>
> Yeah. :) I actually prefer that syntax anyway; I've gotten kind of
> allergic to barewords.
>
> [...]
Pleased to say that there are no more bareword file handles (except the
STD{IN,OUT,ERR} ones) in Lintian. :)
I also vastly improved our "check return value of <func>" coverage by
using autodie. Except for some scripts in private/*, frontend/lintian
and reporting/harness, we got 100% coverage of calls to [1]. The listed
files are missing a couple of checks for "close". NB: We still got
plenty of files without autodie enabled.
The downside of that medal is that autodie has a steep price on our
startup time. AFAICT, we are looking at about 1.5s extra startup time
since the 2.5.12 release. On a related note, there is an upstream bug
for it at [2].
~Niels
[1] open opendir chdir read readdir readline closedir sysopen sysread
sysclose mkdir link pipe readlink unlink rename symlink fork close
[2] https://rt.cpan.org/Public/Bug/Display.html?id=46984
Reply to: