http://www.perlmonks.org?node_id=557673


in reply to Re^2: Objects as arrays but with autogenerated getters + setters
in thread Objects as arrays but with autogenerated getters + setters

package Foo; use Class::MakeMethods::Template::Array ( 'new' => 'new', 'scalar' => [ -interface=> { 'get_*'=>'get', 'set_*'=>'set' }, qw/ name age city job salary /, ], ); package main; use Data::Dumper; my $foo = Foo->new(); $foo->set_name("foo"); $foo->set_age(100); warn Data::Dumper->Dump([$foo], ['foo']); print $foo->get_age,$/; $foo->set_age(23); print $foo->get_age,$/;

--Solo

--
You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.