Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Re: Private method variations

by esskar (Deacon)
on Mar 01, 2004 at 02:09 UTC ( #332751=note: print w/ replies, xml ) Need Help??


in reply to Re: Private method variations
in thread Private method variations

Well, normally "private" variables are named with an "_" at the beginning as a key in the blessed hashref...
since the blessed object is "just" a normal data structure in perl, it is always possible to access the data within that structure... but why does the user who is using your module want to kill himself by not using your methods but accessing the datastructure itself?!?
On your hand, Perl OO is not as other OO programming like in C++ or java. The blessed "thingy" is not your class object but just an object within your class. so it can not know anything about public or private.

Hope, i got it right!

Update:Daim... i missed the original post...sorry...stupid mistake...


Comment on Re: Re: Private method variations
Replies are listed 'Best First'.
Re: Re: Re: Private method variations
by flyingmoose (Priest) on Mar 01, 2004 at 05:28 UTC
    On your hand, Perl OO is not as other OO programming like in C++ or java

    It's a good thing that it's not like C++ (restrictive) or Java (broken), but I still say there is room for improvement. Using underscores is cheesy and was one of the reasons I scoff at Python when people claim it has a good OO model.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (19)
As of 2015-07-29 14:02 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