in reply to Basic Accessor Methods using Class::Multimethods

I think if you just want accessor/mutator methods, you might be better off with a more focused module: Class::Accessor. It's extremely simple:

package My::Class; use strict; use base qw( Class::Accessor ); My::Class->mk_accessors( qw( field1 field2 field3 ) );

That's it! This creates the methods 'field1', 'field2', and 'field3' which act as accessors/mutators. You can also inherit a simple new() method and a number of other actions. IMO, the docs are well-written and easy to follow, and while there are a few dependencies the CPAN shell should TCB for you...

Chris
M-x auto-bs-mode

Replies are listed 'Best First'.
Re: Re: Basic Accessor Methods using Class::Multimethods
by ignatz (Vicar) on Feb 27, 2002 at 21:49 UTC
    Thanks for the replay. The problem is that I am trying to get Multimethods to do more complex stuff and I stumble over this simple problem.