Re: finding invalid method names
- From: "attn.steven.kuo@xxxxxxxxx" <attn.steven.kuo@xxxxxxxxx>
- Date: 27 Apr 2007 17:39:32 -0700
On Apr 27, 3:41 pm, i...@xxxxxxxxxx wrote:
Hi,
I would like to run a command on my perl scripts / modules to find out if
there are any method names that are being called which are not defined.
So for example where I run:
perl -c test.pl
on this script:
1 #!/usr/bin/perl
2 use strict;
3
4 blah_blah_foo();
The result is test.pl syntax OK.
Is there any other program i can run to do a static analysis of perl code
and find these errors?
Function names? I'd use Perl::Critic with
Perl::Critic::StricterSubs. E.g.,
$ perlcritic -theme "strictersubs" demo.pl
Subroutine "blah_blah_foo" is neither declared nor explicitly imported
at line 4, column 1. This might be a major bug. (Severity: 4)
A caveat from the documentation mentions false violations.
In any case, if you use Perl::Critic (static checks) as well as
TAP-based tests (e.g., Devel::Cover, Test::More, Test::Pod::Coverage,
etc.), you (or your boss) should start to feel better about
code quality.
--
Hope this helps,
Steven
.
- References:
- finding invalid method names
- From: ivan
- finding invalid method names
- Prev by Date: Re: Weird error after a configuration change
- Next by Date: Re: Cat file a to *.xls files
- Previous by thread: finding invalid method names
- Next by thread: Re: finding invalid method names
- Index(es):
Relevant Pages
|
|