This is an excerpt from the latest version perlfaq7.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at
http://faq.perl.org .
--------------------------------------------------------------------
7.25: Why can't a method included in this same file be found?
Some possible reasons: your inheritance is getting confused, you've
misspelled the method name, or the object is of the wrong type. Check
out perltoot for details about any of the above cases. You may also use
"print ref($object)" to find out the class $object was blessed into.
Another possible reason for problems is because you've used the indirect
object syntax (eg, "find Guru "Samy"") on a class name before Perl has
seen that such a package exists. It's wisest to make sure your packages
are all defined before you start using them, which will be taken care of
if you use the "use" statement instead of "require". If not, make sure
to use arrow notation (eg., "Guru->find("Samy")") instead. Object
notation is explained in perlobj.