Module::Checkstyle::Check::Variable - Checks variable declarations
The checks provided by this module currently only works for variables declared using my, our or local. It may in the future also support use vars qw(...); style declarations.
use vars qw(...);
The checks arrays-in-plural and hashes-in-singular works best with the english language and may not always be correct. Internally it uses Lingua::EN::Inflect::Number that relies on Lingua::EN::Inflect do determine plural/singular forms.
Checks that a variable is named correctly. Use matches-name to specify a regular expression that must match.
matches-name = qr/\w+/
Checks that an array has a plural name as in @values but not @value. Set arrays-in-plural to a true value to enable.
@values
@value
arrays-in-plural = true
Checks that a hash has a singular name as in %key but not %keys. Set hashes-in-singular to a true value to enable.
%key
%keys
hashes-in-singular = true
Writing configuration files. "Format" in Module::Checkstyle::Config
Module::Checkstyle
Lingua::EN::Inflect::Number
Lingua::EN::Inflect
To install Module::Checkstyle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Module::Checkstyle
CPAN shell
perl -MCPAN -e shell install Module::Checkstyle
For more information on module installation, please visit the detailed CPAN module installation guide.