in reply to Re: Inside Class::Accessor
in thread Inside Class::Accessor

$self is, however I dont want all the keys which are in $self, I want the name of all of the accessors which are created for a particular class as well as its parent class

Replies are listed 'Best First'.
Re^3: Inside Class::Accessor
by perrin (Chancellor) on Feb 12, 2008 at 18:08 UTC
    Okay then, subclass the mk_accessors method in your class and stick the names of the fields passed to it into a hash. Then you can just dump that hash when you want it.

      Thanks, I did end up subclassing the method in the end and storing the accessors names in a hash which can access.

      The reason why I want the actual accessors names not the keys of the $self hash is I only want to dump values correctly set with the accessors not any keys set on the hash directly... Don't see why this is such a strange thing to request ?

        An alternative solution: when you put non-accessor values into the hash, you can put them in with leading underscores or some other convention and skip them when dumping the object.
      A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: Inside Class::Accessor
by stiller (Friar) on Feb 12, 2008 at 19:27 UTC
    It is a bit hard to imagine why you want this? The accessor names are pretty predictible after all?