Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
We don't bite newbies here... much

Re: Tracking down the line in error or warning

by VinsWorldcom (Priest)
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.

Comment on Re: Tracking down the line in error or warning
Download Code
Re^2: Tracking down the line in error or warning
by RyuMaou (Chaplain) 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]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2014-04-23 17:32 GMT
Find Nodes?
    Voting Booth?

    April first is:

    Results (551 votes), past polls