table of contents
Perl::Critic::Policy::TooMuchCode::ProhibitUnnecessaryScalarKeyword(3pm) | User Contributed Perl Documentation | Perl::Critic::Policy::TooMuchCode::ProhibitUnnecessaryScalarKeyword(3pm) |
NAME¶
TooMuchCode::ProhibitUnnecessaryScalarKeyword - Finds `scalar` in scalar context.
DESCRIPTION¶
This policy dictates that the use of `scalar` for in statement like this needs to be removed:
my $n = scalar @items;
If the left-hand side of assignment is a single scalar variable, then the assignment is in scalar context. There is no need to add "scalar" keyword.
2023-10-05 | perl v5.36.0 |