Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: OOPerl isn't that bad after all...

by Aristotle (Chancellor)
on Oct 04, 2003 at 17:59 UTC ( [id://296546]=note: print w/replies, xml ) Need Help??


in reply to OOPerl isn't that bad after all...

You want to take a look at Re: Tutorial: Introduction to Object-Oriented Programming and learn about "inside out objects", a technique that gives you all that Java and co do without taking away anything from the freedoms Perl grants. See also Class::InsideOut - yet another riff on inside out objects..

For total isolation, you can also have $self be a closure that carries the properties around as lexicals in its closed scope. It might accept the name of property as its first parameter; or do something else. With this approach, not even instance methods can bypass the encapsulation. This is not really a useful approach, though.

Makeshifts last the longest.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-18 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found