Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (2)
As of 2017-06-26 02:16 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (572 votes). Check out past polls.