-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 =pod You've probably already heard of Sartak's awesome L. As of version 0.25, MooseX::Declare provides some nice sugar for that. This is what it looks like: lang:Perl use MooseX::Declare; role Counter (Str :$name) { has $name => (is => 'rw', isa => 'Int', default => 0); method "increment_${name}" { $self->$name( $self->$name + 1 ); } method "reset_${name}" { $self->$name(0); } } class MyGame::Weapon { with Counter => { name => 'enchantment' }; } class MyGame::Wand { with Counter => { name => 'zapped' }; } Just thought I'd let you know, since i haven't gotten around to actually document this. In case you like it, have some spare tuits, and want to help out, the repository is L :-) =cut -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFKi7dGdC8qQo5jWl4RAkm2AJ9m1S3kzkHl1zgMQfh2bU9pqFLnVwCcCNpN EMIF5I5VMLWrpy/ESf3Bs14= =9SN1 -----END PGP SIGNATURE-----