http://qs1969.pair.com?node_id=237981


in reply to Re: Re: wishlist: static analysis of perl modules
in thread wishlist: static analysis of perl modules

I wanted to second zengargoyle's comment above (++). If you restate the problem as finding subroutines which are never mentioned, as opposed to called, you could do various grep-type searches. Of course, Perl's complex syntax makes it difficult to identify even mentions of subroutines with real precision. If you have a sub called add, for example, you need to know that print "add" is not a subroutine call, but that print "@{[ add ]}" is.)

As for edit my code and change names of a variable or subroutine, wherever it's referred to... well, I admit I typically use a low-tech solution in my editor called "search and replace" :-)

To warn me about private subroutines (sub _foo) being called from outside their class/subclasses: Seems like you could insert a line at the beginning of the private sub that would check UNIVERSAL::isa to see if the calling object is a descendant of the appropriate type.

And finally, increase my attractiveness to women. I am inclined to respond that "I have discovered a truly remarkable technique which this textbox is too small to contain." (With tongue firmly in cheek, and copious apologies to Pierre de Fermat.)

        $perlmonks{seattlejohn} = 'John Clyman';

  • Comment on Re: Re: Re: wishlist: static analysis of perl modules

Replies are listed 'Best First'.
Re: Re: Re: Re: wishlist: static analysis of perl modules
by dash2 (Hermit) on Feb 24, 2003 at 15:00 UTC
    I am inclined to respond that "I have discovered a truly remarkable technique which this textbox is too small to contain."

    "technique"? that's a new word for it (woof woof)

    look what's bursting out of his textbox (fnarr fnarr)

    dave hj~