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

Re: I usually debug via...

by gaal (Parson)
on Feb 15, 2005 at 07:34 UTC ( #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


      So close to a haiku....

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

      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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://431051]
[Eily]: BTW LanX, you should try typing a few random chars at the beginning of each message. This will prevent expansion :P
[LanX]: qwiud you sthink so?
[LanX]: zxwqbd good idea! :)
LanX embraces his new habit spqopiwjdnq
[ambrus]: qQUkZTmHTuKxStGT- BzTIK9gdudif7TkTLI t3mnF144UaAZjkknXY 8nN-QM19wHBsTrp5vB lEYU_Kksa7X1RIBB4x EWLD5X7SW3jGX5ryfN OMn_yL5FTdQxzjhtyX mKN9sjUCzBNHK5Rrp0 S2WMUvIb1i9aZFgjtq VR0GH1bjPMvm1G16iz hBqc1U6toPd4FbJOFj VsOeT745AN1_pO88rD SRAYKtBZwCZedESZmN mvutrOTHiSNwflB- pRfn_k
[Eily]: so far it seems to work
Your Mother reminds the monks they should be grateful not to share an office, lest they be subjugated to constant inanities like, "Czech please!"
[LanX]: what's strange is that the "Cowboy you said this already" message is missing #dqiwd
[LanX]: YM: BTW learn to mute your humanity
[Your Mother]: Cumin? Now I want tacos...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2017-03-27 16:55 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.