.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Perl::Critic::Policy::Variables::ProhibitUnusedVariables 3pm" .TH Perl::Critic::Policy::Variables::ProhibitUnusedVariables 3pm 2025-12-14 "perl v5.42.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Perl::Critic::Policy::Variables::ProhibitUnusedVariables \- Don\*(Aqt ask for storage you don\*(Aqt need. .SH AFFILIATION .IX Header "AFFILIATION" This Policy is part of the core Perl::Critic distribution. .SH DESCRIPTION .IX Header "DESCRIPTION" Unused variables clutter code and require the reader to do mental bookkeeping to figure out if the variable is actually used or not. .PP At present, this Policy is very limited in order to ensure that there aren\*(Aqt any false positives. Hopefully, this will become more sophisticated soon. .PP Right now, this only looks for simply declared, uninitialized lexical variables. .PP .Vb 4 \& my $x; # not ok, assuming no other appearances. \& my @y = (); # ok, not handled yet. \& our $z; # ok, global. \& local $w; # ok, global. .Ve .PP This module is very dumb: it does no scoping detection, i.e. if the same variable name is used in two different locations, even if they aren\*(Aqt the same variable, this Policy won\*(Aqt complain. .PP Have to start somewhere. .SH CONFIGURATION .IX Header "CONFIGURATION" This Policy is not configurable except for the standard options. .SH AUTHOR .IX Header "AUTHOR" Elliot Shank \f(CW\*(C`\*(C'\fR .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 2008\-2021 Elliot Shank. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module.