http://qs321.pair.com?node_id=431051


in reply to I usually debug via...

I'm a printer.

Long ago I put these two lines at the bottom of a script; nowadays I always throw them into my exception handling modules, but push them to main::.

sub ::D { require Data::Dumper; $Data::Dumper::Indent += 0; local $Dat +a::Dumper::Indent = 1; Data::Dumper::Dumper(@_) } sub ::DD { require Carp; Carp::confess(::D(@_)) } # Then from anywhere, use it like this: print ::D({ state => $some_obj }); [...] ::DD($obj) if $bugs_exist;

(The += 0 is just a stupid warning silencer.)