Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > finding invalid method names

Reply
Thread Tools

finding invalid method names

 
 
ivan@0x4849.net
Guest
Posts: n/a
 
      04-27-2007
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?

Thanks,

--
Ivan Novick
http://www.0x4849.net
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      04-28-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> 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();



There are no method calls anywhere in that code.


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
 
Michael Carman
Guest
Posts: n/a
 
      04-28-2007
On 4/27/2007 5:41 PM, (E-Mail Removed) wrote:
>
> 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.


Method dispatch happens at runtime. There's really no way for a static analysis
tool to determine whether or not a given method call is valid.

> 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.


Umm, as Tad said, there are no method calls in that code. Did you want to ask
about detecting undefined *subroutines*?

-mjc
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
method names-how to indicate get vs set type of method? Greg Hauptmann Ruby 1 11-06-2008 03:19 AM
Invalid URI: There is an invalid sequence in the string. Error!! Patrick.O.Ige ASP .Net 1 07-02-2006 11:21 AM
Finding method names bigbinc@hotmail.com Java 1 04-27-2005 01:10 PM
Re: fetching method names from a class,and the parameter list from a method John Lenton Python 0 01-11-2005 05:12 AM
invalid@invalid.org Hank Sniadoch Computer Information 1 08-20-2004 11:24 AM



Advertisments