Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Warning gets the line number wrong?

by rodion (Chaplain)
on Apr 30, 2007 at 10:33 UTC ( #612730=note: print w/replies, xml ) Need Help??

in reply to Warning gets the line number wrong?

Tracking line numbers for warnings can be tricky. Sometimes it's neccessary to put little progress report warnings in the uncertain area, as in
warn "before if"; if ($_[$i] =~ /^(.+?)\.(zip|t?gz|tar|bz2?|tbz)$/i) { warn "in if" ... elsif (...) { warn "in elsif 1"; ... else { warn "in else";
With these in place, you can tell where the "undefined" warning comes in the sequence of execution. It's messy, but you only have to look at it once, for a quick reality check. The debugger is another way to do this, which could be easier or harder, depending on your inclination to switch over to the debugger mindset.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://612730]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2021-09-24 10:24 GMT
Find Nodes?
    Voting Booth?

    No recent polls found