in reply to Undefined Subroutine errors

Not that I am aware of.

There are several reasons why undefined functions are not caught at compile time, here are a few:

Autoloading
See AUTOLOAD in the perlsub document.

Conditional calling of functions

sub test { my $object = shift; $object->somefunction if $object->can('somefunction'); }
In the above example somefunction is only called if the passed object has this method defined.

This is useful when you might have different objects being used that conform to a common interface, but have some additional capabilities.

Also useful when you might be dealing with older versions of a module that do not support certain methods.

Checking if an object can do something is generally preferrable to checking if an object is something

Replies are listed 'Best First'.
Re^2: Undefined Subroutine errors
by imp (Priest) on Jul 17, 2006 at 20:32 UTC
    Actually there is one very reliable way to detect these situations - a comprehensive test suite.

    Your test suite should have a test (or several) written for each of the cases that should cause a failure. If this test suite was run before each release you would catch the error that this post references.

    Writing a compehensive set of tests can be an intimidating task, but the amount of time it will save you in the long run is well worth it.

    Here is an article describing perl best practices, it has 10 tips from Damian Conway's excellent Perl Best Practices book.

      I can't claim the test suite was comphrensive since it obviously wasn't. I've added a case that will cause the branch in question to be taken. I'll take a look at he article you referenced, thanks.
Re^2: Undefined Subroutine errors
by ikegami (Patriarch) on Jul 17, 2006 at 20:27 UTC
    Run-time loaded functions and run-time generated function calls form the minority of functions and calls. A tool that can't handle those exceptions might exist and would still be valuable.