Perl :: Critic 'Code before strictures' when using Modern :: Perl

I understand that it is better to use Modern :: Perl than to use strict and warning.

With the default settings, Perl :: Critic v1.121 complains about the code before a strict check, even when "Use Modern :: Perl" is used before using the code.

QUESTION: Is the best solution for updating perlcriticrc configuration as shown below, or is there a better way?

Configuration source below

cat ~ / .perlcriticrc

[TestingAndDebugging::RequireUseStrict] equivalent_modules = Modern::Perl [TestingAndDebugging::RequireUseWarnings] equivalent_modules = Modern::Perl 

Also worth noting: Developer discussion here

+5
source share
2 answers

You can โ€œuse 5.014โ€ (or higher, if available) to implicitly enable โ€œuse strictโ€ right in the first line. Perl :: Critics like this native approach much more. After that, you can continue to use the use of Modern :: Perl if you still feel the need.

+1
source

I just ran into the same perlcritic problem and I definitely use the .perlcriticrc solution. It automatically processes all my old programs, avoiding the need to return and touching them all.

0
source

Source: https://habr.com/ru/post/1200084/


All Articles