Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://332751]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2018-01-24 04:07 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (255 votes). Check out past polls.