Object::Nano - No frills class building, with readable and writable accessors
I've tried different class builders, my favorite being Object::Tiny for its simplicity, speed, compactness, etc.. but unfortunately when I needed to create writable accessors I became stuck. So, Object::Nano was born. All it does is build you a simple class and creates readable/writable accessors. Oh, and imports warnings and strict, so you don't need to do that either. Not really fussed about writable accessors and warnings/strict? Then you're probably better off with Object::Tiny
package MyClass; use Object::Nano qw<name level email>; 1;
After the above you have a full-working class with a few usable accessors. So you can do something like...
use TestClass; my $t = TestClass->new( name => 'Foo', level => 15, ); $t->email('foo@foo'); # updated the email accessor
Brad Haywood <brad@perlpowered.com>
You may distribute this code under the same terms as Perl itself.
To install Object::Nano, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Object::Nano
CPAN shell
perl -MCPAN -e shell install Object::Nano
For more information on module installation, please visit the detailed CPAN module installation guide.