Hi,
I have two suggestions for you - one of which you may already know. First is that if you have not put use strict in your code, you really should. Most of these you can track down with the extra messages that use strict; presents.
If you have a legitimate condition where a value is used only once then there is another trick you can use to get rid of these: create a subroutine that is never called and use the variables in there:
# You never, ever want to call this.
sub perl_unused_by_me
{
# You have to make sure your scope is correct here.
$main::variable = 0;
# You might also consider something like
# undef $main::variable;
# so that if this gets called by accident then your
# code will produce an error at that point, not
# silently use the bad data.
}
Important: I really believe that if you need to do this, then there is something wrong with the way you have approached your program design. I found that as my skill increases situations where I have to do this have disappeared. In my mind that means I was initially doing things the wrong way. Usually that means using globals where passing by reference, even some slick OO or something (anything) more attractive would get the job done.
Good luck,
{NULE}
--
http://www.nule.org |