in reply to Re: Re2: line number
in thread line number
dmitri's solution returns the line number of the call to the current subroutine.Yes, but the two are the same. The "current subroutine" (as far as caller() is concerned) is the one created right there on that line.
Its creating and calling a sub whose sole purpose is to find the linenumber of its caller.$linenum = &{sub{(caller)[2]}};
Its like phoning a friend to ask what number shows up on his caller ID... Why bother when your own phone number is pasted right there on the front of your phone?
-Blake
|
|---|