Object Inspector?

Ovid on 2009-01-29T11:04:08

I'll write the code if I have to, but I can't imagine that someone else hasn't. Given this:

my $report = Class::Inspector->inspect($class_or_instance);

And with that, $report should be able to tell me a few things:

  • Give me a directed graph showing the intheritance tree
  • Give me a collection of overridden methods and which classes override
  • Give me a list of actual methods
  • Issue warnings about potential MI conflicts (e.g., horizontal and diamond conflicts)

Note that all method objects should, at the least, provide all of the information that Sub::Information does (origin, code, name, etc.).

That's all I can think of right now. I really wish I could do things like inspect signatures or do a deeper inspection to ensure sanity, but I think that's out. Any other suggestions?


Devel::Symdump

daxim on 2009-01-29T13:20:35

http://search.cpan.org/dist/Devel-Symdump/

Low level tool, solves your topics #1 and #3.

Class::MOP

rafl on 2009-01-29T17:05:54

Class::MOP makes it trivial to implement all those things. Read up on Class::MOP::Class and Class::MOP::Method.