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

Re: perl oop concept

by sundialsvc4 (Abbot)
on Dec 04, 2012 at 16:41 UTC ( [id://1007114]=note: print w/replies, xml ) Need Help??


in reply to perl oop concept

By all means, don’t make this a voyage of discovery.   Read the various perldocs on OOP in Perl, and seek out a few recent Perl modules at http://search.cpan.org.   Read the source code of some of them.   (Or just look at the modules already installed on your own system.)   Copy their practices exactly.

Remember the essence of what bless does:   it associates a package-name with some data-object.   It thereby enables the $foo->subname vernacular to be used.   Perl knows to look in the associated package to find the routine, and it calls that routine with $foo as the first parameter.   That’ s basically it.   The data object didn’t cease to be what it is ... the rules for accessing it as a data object haven’t really changed ... it’s merely wearing a halo now, and glowing slightly (and wearing a beneficent smile ...).

(Am I simplifying?   Of course.   But not really over-simplifying, all in the name of simple clarity.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-03-28 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found