Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: List Wrapper for Object Methods.

by Prior Nacre V (Hermit)
on Dec 03, 2004 at 13:38 UTC ( [id://412117]=note: print w/replies, xml ) Need Help??


in reply to List Wrapper for Object Methods.

While I understand that this can be a little disconcerting, you shouldn't let it worry you.

Tutorials typically indicate this with examples like:

$game->draw; $sword->draw; $picture->draw; $blank->draw;

As an analogy, consider navigating a directory structure. When you type cd lib you will either change to a new directory (dependent on the current directory) or receive an error message (if no lib directory exists). Similarly, invoking the method draw() will either run some code (dependent on the class of the invocant) or will produce an error (Can't find method ...).

As you haven't indicated any inheritance in your question or code, I have avoided a discussion of polymorphism.

A musing: Could the analogy be extended to include polymorphism if I used David Korn's version of cd?

Regards,

PN5

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://412117]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2025-06-21 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.