Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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...

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?
[holli]: what? the pm code you swindled your way into?
[LanX]: no already the pm code I'm allowed to see ... http://www. perlmonks.net/ index.pl?node_id= 1203338;style=css
[LanX]: understanding this code is like relearning space invaders and donkey Kong at the same time

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2017-11-20 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (294 votes). Check out past polls.

    Notices?