On Mon Feb 10 07:36:48 2014, Dallaylaen wrote:
Show quoted text> Hello,
>
> I'd like to have possibility to retrieve line number for a coderef,
> too. I believe $cv->GV->LINE returns something like that, although it
> shows last line of sub rather than the first in my quick test.
>
> I think this module is appropriate place for such functionality.
I agree that it seems a good place.
Note that Sub::Information also gives the file and line of the coderef; I pulled this implementation in the pure perl version of Sub::Identify on github as
https://github.com/rgs/Sub-Identify/commit/74df6318058ec15aace6ff414166d7a8fd378e7e until I get around to do an XS implementation as well.
Compared to your proposal (that returns the last line of the sub), this one returns the line of the 1st statement inside the sub.