[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [lintian] 02/02: Remove "." from @INC



* Niels Thykier <niels@thykier.net>, 2016-07-01, 19:47:
---
collection/ar-info                 | 1 +
[...]
collection/unpacked                | 1 +

I was expecting to see "commands/lintian" here as well, as it is (the only command that is) exec'ed rather than "perl required" by dplint.

Oops. Yes, commands/lintian needs "." removed from @INC too.

 use strict;
 use warnings;
 use autodie;
+no lib '.';

Shouldn't these come before the first "use"? Rather, can we even protect ourselves by using "no lib" - doesn't that load "lib" with the current @INC path?

"." is the last item in @INC, so "no lib" itself should be safe.

"strict", "warnings" and "autodie" are hopefully simple enough that they should be safe too.

I seemed to recall that perlcritic doesn't like "no lib" before "use strict" or "use warnings", but now I tested it, and it doesn't mind... Oh well, bad memory. I'll move the "no lib"s to the top.

--
Jakub Wilk


Reply to: