Perl::Critic::Policy::ValuesAndExpressions::ProhibitListsInMultiConstants - use a single-constant declaration for lists
This policy as a part of the Perl::Critic::PolicyBundle::SNEZ distribution.
Constants can be lists, however, this can only work if a single constant is declared at a time.
## this is fine use constant MULTI => ('one', 'two', 'three'); use constant SINGLE => 1; # # produces two constants: # SINGLE = 1 # MULTI = ('one', 'two', 'three') ## this is not use constant { MULTI => ('one', 'two', 'three'), SINGLE => 1, }; # # produces three constants: # SINGLE = 1 # MULTI = 'one' # two = 'three'
This policy detects raw lists in the hashref form of constant declaration.
This Policy is not configurable except for the standard options.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Perl::Critic::PolicyBundle::SNEZ, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Critic::PolicyBundle::SNEZ
CPAN shell
perl -MCPAN -e shell install Perl::Critic::PolicyBundle::SNEZ
For more information on module installation, please visit the detailed CPAN module installation guide.