Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This noncompliant code example contains a variable $new_name that is initialized , but never subsequently read.

Code Block
bgColor#ffcccc
langperl

sub fix_name {
  my $name = shift;
  my $new_name = $name;

  $name =~ s/^([a-z])/\U$1\E/g;
  $name =~ s/ ([a-z])/ \U$1\E/g;
  return $name;
}

...

Code Block
bgColor#ccccff
langperl

sub fix_name {
  my $name = shift;

  $name =~ s/^([a-z])/\U$1\E/g;
  $name =~ s/ ([a-z])/ \U$1\E/g;
  return $name;
}

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

MSC01-PL

low Low

unlikely Unlikely

high High

P1 L1

L3

Automated Detection

Tool

Diagnostic

Perl::Critic

Variables::ProhibitUnusedVariables

Related Guidelines

...

...

...

...

Automated Detection

Tool

Diagnostic

Perl::Critic

Variables::ProhibitUnusedVariables

Bibliography

 

...

Image Added Image Added EXP30-PL. Do not use deprecated or obsolete functions      02. Expressions      Image Modified