Perl - Debugging
Finally, I have to debug a perl script. These are some of the helpful command. I am assuming the perl debugger version 1.27
perl -d myscript.pl
See the attached image for example
- 1. Debugging - Adding -d will trigger a debug mode on your perl script
perl -d myscript.pl
- Stepping - Type s in debug console will let you step through your code line by line
- Break Point - Type b (line number) in debug console will let you set a break point
b 100
- Print variable - Type p (variable) in debug console will display your variable value
p $varname
- Continue - Type c in debug console will bring you to the next break point
- Delete a Break Point - Type B (line number) in debug console to remove a break point
B 100
- List all break point/action - Type L in debug console to list all breakpoint and action
- Watch - Type w (variable) in debug console to set a watch to the variable. Changes will appear on the debug console if your watch variable is altered
w $varname
- Delete a Watch - Type W (variable) in debug console to delete a watch point
W $varname
- Help - Type h in debug console to get help list
- Reload - Type R in debug console to reload the program in debug mode
- Quit - Type q in debug console to quit debugging
See the attached image for example
Comments
Post a Comment