FAQ 7.25 Why can't a method included in this same file be found?

Discussion in 'Perl Misc' started by PerlFAQ Server, Apr 10, 2011.

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

    Make sure to read about creating modules in perlmod and the perils of
    indirect objects in "Method Invocation" in perlobj.



    --------------------------------------------------------------------

    The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
    are not necessarily experts in every domain where Perl might show up,
    so please include as much information as possible and relevant in any
    corrections. The perlfaq-workers also don't have access to every
    operating system or platform, so please include relevant details for
    corrections to examples that do not work on particular platforms.
    Working code is greatly appreciated.

    If you'd like to help maintain the perlfaq, see the details in
    perlfaq.pod.
     
    PerlFAQ Server, Apr 10, 2011
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    428
    Patrick
    Apr 22, 2004
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    912
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,004
    Smokey Grindel
    Dec 2, 2006
  4. PerlFAQ Server
    Replies:
    0
    Views:
    109
    PerlFAQ Server
    Jan 29, 2011
  5. jodleren
    Replies:
    1
    Views:
    118
    jodleren
    Sep 18, 2008
Loading...

Share This Page