[Israel.pm] Perl Refactoring?

Issac Goldstand margol at beamartyr.net
Sun Nov 7 02:13:30 PST 2004


Also, if you use a variable only once, Perl gives you a warning ($var used 
only once - possible typo) if you use warnings;

----- Original Message ----- 
From: "Scott Weisman" <sweisman at pobox.com>
To: "Perl in Israel" <perl at perl.org.il>
Sent: Sunday, November 07, 2004 12:09 PM
Subject: Re: [Israel.pm] Perl Refactoring?


> You could try adding "use strict" and then commenting out the 
> declarations. "perl -c" will then show errors if the variable is used.
>
> Scott
>
> Yuval Yaari wrote:
>> Hi,
>>
>> I am the not-so-proud owner of amazingly nasty pieces of code (not 
>> written by me, so I take no responsibility :)).
>> Trying to refactor some of them, I found out that I have many variables 
>> that are defined with some meaningless value and are never used.
>> Is there a simple way to find out all the variables that are never 
>> actually used?
>> I would like to remove them entirely from my code, as they make it look 
>> even worse for no reason at all.
>>
>> Any other refactoring tools/techniques are welcome :)
>>
>>  --Yuval
>>
>> _______________________________________________
>> Perl mailing list
>> Perl at perl.org.il
>> http://perl.org.il/mailman/listinfo/perl
>>
>> .
>>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
> 




More information about the Perl mailing list