Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Objects with Private Variables

by misterb101 (Sexton)
on Jun 07, 2005 at 09:36 UTC ( #464201=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Objects with Private Variables
in thread Objects with Private Variables

Looking good David!

The only thing I would change is to let $self be the ref to the closure and use another name for the actual data storage. This way you always know that $self is the ref to your object. For instance if you want to call a couple of private methods in your constructor after blessing your variable it would be more staightforward to do
$self->_privateMethod();
than
$access->_privateMethod();

Cheers,
Rob


Comment on Re^3: Objects with Private Variables
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (15)
As of 2015-07-29 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls