Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: OOP's setter/getter method - is there a way to avoid them?

by shmem (Chancellor)
on Oct 27, 2015 at 22:51 UTC ( [id://1146190]=note: print w/replies, xml ) Need Help??


in reply to OOP's setter/getter method - is there a way to avoid them?

For real encapsulation of an objects data, which provides black box inheritance, is thread safe and has little impact on performance, check Alter, which has received too little attention by the Perl Community up to now.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
  • Comment on Re: OOP's setter/getter method - is there a way to avoid them?

Replies are listed 'Best First'.
Re^2: OOP's setter/getter method - is there a way to avoid them?
by Arunbear (Prior) on Oct 28, 2015 at 11:19 UTC
    The author of Alter also wrote Hash::Util::FieldHash which is a core module and has a similar goal to Alter.

      oh. I wasn't aware that Alter had indeed been added to the perl core, under another name. And it's in there since 5.10! Yay! Thanks for the hint, Arunbear!

      (hint to $self: take the time to read perldeltas!)

      perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 01:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found