Ryan Frantz wrote:
> I'm (very) new to Perl but I thought there was an easier way to do
> this. I use the '-w' switch when specifying my interpreter at the
> beginning of my script:
> 
> #!/usr/bin/perl -w
> 
> and it always tells me if I have a declared variable that doesn't get
> used.
> 
> ry

        You are not using strict because if so then declaring say my $abc; and 
using strict and -w, I do not get any warning.  Hopefully one of Perl gurus can 
enlighten us.

Wags ;)
> 
> -----Original Message-----
> From: Bob Showalter [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 08, 2005 2:52 PM
> To: 'Troy S'; beginners@perl.org
> Subject: RE: perl question - unused variables
> 
> Troy S wrote:
>> How can i automatically detect unused variables in Perl?
>> 
>> i delcrae variables like:
>> my $abc;
>> 
>> but don't use $abc within the subroutine.
>> 
>> how can i get perl to autmatically tell me that $abc is not being
>> used (other than the declaration)????
> 
> Possibly use the output of B::Xref to look for variables with only an
> introduction ("i")?
> 
> perldoc B::Xref
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>



*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


  • RE: perl question - un... Wagner, David --- Senior Programmer Analyst --- WGO

Reply via email to