Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: I usually debug via...

by gaal (Parson)
on Feb 15, 2005 at 07:34 UTC ( [id://431051]=note: print w/replies, xml ) Need Help??


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

    I debug my code with print,
    my mind with alcohol,
    and my dog with flea powder

      chime~

      So close to a haiku....

      debug code with print
      a mind using alcohol
      dogs with flea powder

      Boots
      ---
      If you are not going to go 95, just avoid our state. Please.
      -Ian Sulam
        But it's still not a haiku (at least to my limited understanding) because it's not about a seasonal event, and his original form, I feel, reads much more poetically. What is with this obsession of things that look similar to haikus? Is it just that they appear easy to create and everyone wants to be a poet?

        Heres one I made earlier on the same theme

        Bug haiku

Re^2: I usually debug via...
by RolandGunslinger (Curate) on Feb 22, 2005 at 15:14 UTC
    print and perl -d for me between these two I get my debugging done oh, and heavy use of Data::Dumper

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://431051]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-25 19:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found