Perl-Sensitive Sunglasses | |
PerlMonks |
Re^2: Object Browser for Perl?by QM (Parson) |
on Jul 08, 2013 at 13:54 UTC ( [id://1043125]=note: print w/replies, xml ) | Need Help?? |
Examining objects, especially changes to objects between runs, is problematic because:
(1) There is a lot of data in an object, so complete Data::Dumper output runs hundreds or thousands of lines. I can reduce this with 'depth', but then runs may not be so easily compared, as truncated object trees end with 'key' => 'Blah::Foo::Bar=HASH(0xdeadbeef)'. (Not such a big win anyway, since internal pointers dump as $VAR1->{blah}.) I could also give a list of interesting keys to dump, which requires another iteration. (2) I'm using a large library, that I'm only superficially acquainted with, that adds lots of uninteresting data to the objects in many places. It would probably be easier if the library added stuff under a top-level key like 'internal_machinations', where I seldom need to access anything from my code. (3) There's a shared resource key at many levels, pre-arranged so that $self->{'resource'} points to the same instance, regardless of $self. So in some cases I have to worry about clobbering existing data there, etc. (4) There are very few accessors in the large library, and only for specific, often-used attributes. -QM
In Section
Seekers of Perl Wisdom
|
|