Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Tracking down the line in error or warning

by VinsWorldcom (Parson)
on Mar 24, 2009 at 13:12 UTC ( #752859=note: print w/replies, xml ) Need Help??

in reply to Tracking down the line in error or warning

When I run that code, I get:

{C} > Use of uninitialized value in pattern match (m//) at C:\tmp\ lin +e 10.

Line 10 is the pattern match in question. In any case, if it had spewed line 6, I would have looked at the IF block starting there and inserted some trusty "print "HERE\n" debug helpers to see where I was getting dumped out.

For more complicated logic trees and loops, I use PerlIDE - a simple freeware development tool that can do a step into/over debug which is really helpful if I'm stuck.

Replies are listed 'Best First'.
Re^2: Tracking down the line in error or warning
by RyuMaou (Deacon) on Mar 24, 2009 at 13:52 UTC
    Yeah, I was going to throw that in, too. Some well placed print statements can really make debugging easier.

    Also, and this may be obvious, but a text editor that shows the line numbers and highlights code can be a big help, too. Scanning through huge scripts looking for all the opening and closing brackets on functions is a lot easier when code is all pretty. It's embarrassing to me how many times my errors have just been one too many, or too few, brackets, parenthesis, or some similar typo.
Re^2: Tracking down the line in error or warning
by PoorLuzer (Beadle) on Mar 24, 2009 at 14:10 UTC
    Wow.. this version of PERL is nice.

    The original code that I "debugged" used PERL 5.8 for HPUX and the error message I posted was from ActivePerl 5.10.. both gave the same error message (5.8 did not show the $_ however)

    No other way than PerlIDE (which I believe runs only on Windows)?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://752859]
[Discipulus]: yes erix when you specify a Tk geometry 10x10 it goes from 0,0 to 10,10 aka 11x11

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2018-04-24 09:04 GMT
Find Nodes?
    Voting Booth?