in reply to Inside Class::Accessor

So... what's the problem? Isn't $self a hash already?

Replies are listed 'Best First'.
Re^2: Inside Class::Accessor
by ropey (Hermit) on Feb 12, 2008 at 15:29 UTC

    $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

      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 ?

        A reply falls below the community's threshold of quality. You may see it by logging in.
      It is a bit hard to imagine why you want this? The accessor names are pretty predictible after all?