Data :: Printer to the rescue! This dump of the object is more readable:
my $obj = SomeClass->new; p($obj);
It is compatible with Template Toolkit:
[% USE DataPrinter %] html-formatted, colored dump of the same data structure: [% DataPrinter.dump_html( myvar ) %]
And he "knows" how to handle DBIx :: Class too:
use Data::Printer filters => { -external => [qw[DB]], # use DB filter }, class => { expand => 2, # traverse object 2-levels deep linear_isa => 0, # hide not-so-relevant information }; ... my $obj = $schema ->resultset('AddressState') ->search({}, { prefetch => [qw[country]] }) ->single; p $obj;
source share