in reply to Prevent direct acces to object's attributes
This is possible, but you're doing something wrong if you want to do this.
The so-called "inside-out" objects are a solution to this perceived problem, InsideOut is a search that gives you at least Object::InsideOut and Class::InsideOut, and likely many more implementations.
The Cool Train has left inside-out land about two years ago and all the cool kids use Moose nowadays. At least in respect towards interoperability, Moose-based objects are less problematic than inside-out objects.
Why do you want to prevent access to object values using $obj->{...}? Maybe you want to educate your project members to not do that? For example Data::Dumper won't work with inside-out objects...
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Prevent direct acces to object's attributes
by JavaFan (Canon) on Sep 07, 2009 at 18:19 UTC | |
by Corion (Patriarch) on Sep 07, 2009 at 18:25 UTC | |
by JavaFan (Canon) on Sep 07, 2009 at 20:28 UTC | |
by SuicideJunkie (Vicar) on Sep 08, 2009 at 14:20 UTC | |
by JavaFan (Canon) on Sep 08, 2009 at 16:12 UTC | |
Re^2: Prevent direct acces to object's attributes
by vitoco (Hermit) on Sep 07, 2009 at 18:19 UTC | |
by FunkyMonk (Chancellor) on Sep 07, 2009 at 22:12 UTC | |
by JavaFan (Canon) on Sep 08, 2009 at 09:57 UTC |