Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: line number

by jkahn (Friar)
on Sep 12, 2002 at 14:00 UTC ( #197226=note: print w/ replies, xml ) Need Help??


in reply to line number

carp and croak traverse the values returned by the caller() builtin function (see perldoc -f caller).

The code inside the Carp module is pretty hairy stuff, but it makes for interesting reading. I found the most interesting parts were the sections of code added so that the warning was issued in the code outside the package -- or any child or parent package -- so that OO Perl still works. Neat stuff.

Added:The Carp code travels up the call stack (via caller()) until it finds the first routine that calls itself that isn't in the current package (or one of its relatives, so that method inheritance works).


Comment on Re: line number
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-12-23 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (135 votes), past polls