Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debugger breakpoint on -w warning?

Status
Not open for further replies.

csatt

Technical User
May 23, 2002
1
US
I'm a devoted user of the -w switch. Probably the most common warning I get is:

Use of uninitialized value at foo.pl line 226, <F> chunk 115081.

It isn't always obvious which variable is uninitialized or why, so I run my script under the debugger. I then guess which variable on that line is uninitialized, and set a breakpoint, e.g.:

DB<2> b 226 !defined $foo1
DB<2> c

If I'm correct, the breakpoint is hit. If not, then I try the other variables until I find the one that is undefined. Alternately, I can assure myself of hitting the breakpoint by testing all the variables used on that line:

DB<2> b 226 !defined $foo1 || !defined $foo2 || !defined $foo3

Then I can display all of their values to see which one is undefined.

Either way is a pain. What I really want is a way to run my script under the debugger with the -w option, and simply tell it to break on any warning.

Anyone know how to do this?

- Chris
 
u have to modify perl.exe cause -w is a parameter to it
i think.... ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top