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

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.

Replies are listed 'Best First'.
Re^4: Inside Class::Accessor
by ropey (Hermit) on Feb 13, 2008 at 09:19 UTC

    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.