Perl::Critic::Policy::TooMuchCode::ProhibitUnnecessaryScalarKeyword(3pm)

Perl::Critic::Policy::TooMuchCode::ProhibitUnnecessaryScalarKeyword3pm

Finds `scalar` in scalar context.

Overview

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.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

From libperl-critic-toomuchcode-perl 0.19-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.