in reply to Warning for "unused sub declarations"?

How could Perl know this in the face of AUTOLOAD, run-time module loading, and symbol table manipulation?

The best I can see it doing is trying to resolve subroutine calls as they happen and throwing errors if it can't find them.

(I think your code has a bareword problem that makes it give an ambiguous error message, but that's just a guess looking at the snippet and not its context.)

Replies are listed 'Best First'.
Re^2: Warning for "unused sub declarations"?
by revdiablo (Prior) on May 19, 2005 at 18:59 UTC
    How could Perl know this in the face of AUTOLOAD, run-time module loading, and symbol table manipulation?

    It wouldn't be foolproof, but could the warning be somewhat like the "Name %s used only once" warnings with package variables? Example included for those who don't know what I'm talking about:

    $ perl -wle '$foo = 1; print 5' Name "main::foo" used only once: possible typo at -e line 1. 5
Re^2: Warning for "unused sub declarations"?
by Fletch (Bishop) on May 19, 2005 at 20:42 UTC

    Not to mention even $obj->$method( ) or $methref = $obj->can( "kwyjibo" ).