Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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
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 imbibing at the Monastery: (6)
As of 2014-07-10 04:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (198 votes), past polls