in reply to Identify Unused and Uninitialised variables.

Always

use strict; use warnings;

That will help a lot!


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e

Replies are listed 'Best First'.
Re^2: Identify Unused and Uninitialised variables.
by JavaFan (Canon) on Jan 14, 2009 at 11:22 UTC
    Pray tell me, how's "use strict" going to help you here? In fact, it may even be harder to find unused variables when using "use strict", as "use strict" usually means people will use lexical variables instead of package variables.

    But, with warnings on, Perl will warn about unused (or used only once) variables, while it will remain silent about unused lexicals.