Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: List Wrapper for Object Methods.

by Prior Nacre V (Hermit)
on Dec 03, 2004 at 13:38 UTC ( #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? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-05-20 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (76 votes). Check out past polls.

    Notices?