Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: perl oop concept

by sundialsvc4 (Monsignor)
on Dec 04, 2012 at 16:41 UTC ( #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.)


Comment on Re: perl oop concept

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-08-30 19:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls