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.)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: I usually debug via...
by chime (Friar) on Feb 15, 2005 at 10:23 UTC | |
by Boots111 (Hermit) on Feb 17, 2005 at 00:03 UTC | |
by BUU (Prior) on Feb 20, 2005 at 08:09 UTC | |
by legato (Monk) on Mar 03, 2005 at 19:53 UTC | |
by greenFox (Vicar) on Mar 09, 2005 at 01:57 UTC | |
| |
by Anonymous Monk on Feb 21, 2005 at 21:05 UTC | |
by chime (Friar) on Feb 22, 2005 at 10:34 UTC | |
Re^2: I usually debug via...
by RolandGunslinger (Curate) on Feb 22, 2005 at 15:14 UTC |
In Section
Past Polls