Class::InsideOut 1.01 just hit CPAN.
After seeing Damian's "Sufficiently Advanced Technologies" presentation, I decided to add some automation for common cases. register() now blesses for you and even provides an anonymous scalar reference if you don't give it one. A basic constructor is as simple as this:
sub new { register shift }
Going one step further, an optional and very simple constructor is provided on request that automatically initializes properties from the arguments to new(). A minimal Class::InsideOut based class is now as easy as this:
package My::Class; use Class::InsideOut qw/ new id public private /; public name => my %name; private age => my %age; 1;
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Class::InsideOut 1.01 now with added sugar
by clscott (Friar) on Jul 27, 2006 at 21:42 UTC | |
by xdg (Monsignor) on Jul 27, 2006 at 22:25 UTC | |
by Aristotle (Chancellor) on Jul 27, 2006 at 22:45 UTC | |
by xdg (Monsignor) on Jul 28, 2006 at 04:23 UTC | |
by Aristotle (Chancellor) on Jul 28, 2006 at 12:09 UTC | |
|