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

Re: Using the perl debugger

by graff (Chancellor)
on Mar 15, 2009 at 21:06 UTC ( [id://750779]=note: print w/replies, xml ) Need Help??


in reply to Using the perl debugger

if I'm on line 61, I want to not execute whatever is on line 61 and goto line 62.

I think your only option is to edit the script first to comment out line 61, then run with the debugger with a breakpoint at line 62. If, upon reaching line 62, you decide you want to apply whatever was on line 61, just paste that line of code as a debugger command, and now things would be just as if line 61 had not been commented out.

Another approach would be to create a new variable and wrap line 61 inside a conditional block on that variable like:

my $dbg61 = 0; # <- add this line if($dbg61){ original code of line 61 }
Then when you step to the original line 61 (which now begins with if($dbg61), and which might now be line 62 because you had to add a line above it), you can just reset the value of $dbg61 according to whether you really want that line to execute.

This poses the dilemma that in order to debug the app, you have to change the code in ways that you wouldn't want to retain in production. But once you figure out whatever is wrong with your original line 61, you should be able to put things back as they are supposed to be.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found