A
A
abskura2013-01-28 01:33:14
Perl
abskura, 2013-01-28 01:33:14

Control of unused variables in perl?

Are there any solutions that will help in finding unused variables in the code?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vyacheslav Golovanov, 2013-01-28
@SLY_G

use strict;
use warnings;
thus, all variables will need to be declared, and perl will issue a warning when a variable is mentioned only once in the code - this will mean that it is declared and not used.
In general, I've been using
use common::sense; lately.
Macro for a good set of directives .

V
vsespb, 2013-01-28
@vsespb

Gives warning:
use warnings; $test_2=1; $test_1 = "hello\n"; print $test_1;
Does not give warning:
use warnings; my $test_2=1; $test_1 = "hello\n"; print $test_1;
2002 bug rt.perl.org/rt3/Public/Bug/Display.html?id=5087 bounty announced
in 2013 rjbs.manxome.org/rubric/entry/1964
Only perl can parse perl

A
Andrey Burov, 2013-01-28
@BuriK666

Google search turned up Perl::Critic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question