justanyone has asked for the wisdom of the Perl Monks concerning the following question:
I'd like to wonder if there's a provision in Perl to give out warning messages about unused variables. C has this. Lint has this for C in more detail. But, it seems Perl doesn't. It could go a ways for helping clean up code.
--- Sample Code Start ---
#!/usr/local/bin/perl -W
use strict;
my $var_a;
print("Hello, world\n");
--- Sample Code End ---
No warning messages are created for this, despite $var_a being unused and irrelevant.
If there is a provision in Perl to do this, please email me. I would be happy to write a module to do this, but I think it probably would be quite difficult and involve lots of Perl internals that probably would change with Perl 6 anyway. Damian & Larry, are you listening? (grin).
Thanks to anyone who responds here or has a hint... Cordially, Kevin
-----------------------------------------------------
Kevin J. Rice
CPAN PAUSE ID: KEVINRICE / Chicagoland, IL, USA
Homepage(with email on it): JustAnyone.com
-----------------------------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need Unused Variable Warning Msgs
by jmcnamara (Monsignor) on Jun 10, 2002 at 18:14 UTC | |
|
Re: Need Unused Variable Warning Msgs
by Abigail-II (Bishop) on Jun 10, 2002 at 16:25 UTC | |
|
Re: Need Unused Variable Warning Msgs
by samtregar (Abbot) on Jun 10, 2002 at 17:05 UTC | |
by Abigail-II (Bishop) on Jun 10, 2002 at 17:10 UTC | |
by samtregar (Abbot) on Jun 10, 2002 at 17:14 UTC | |
by Abigail-II (Bishop) on Jun 10, 2002 at 17:27 UTC | |
by samtregar (Abbot) on Jun 10, 2002 at 17:36 UTC | |
| |
|
Re: Need Unused Variable Warning Msgs
by ninja-joe (Monk) on Jun 11, 2002 at 02:56 UTC |