Skip Menu |

This queue is for tickets about the Sub-Identify CPAN distribution.

Report information
The Basics
Id: 92903
Status: resolved
Priority: 0/
Queue: Sub-Identify

People
Owner: RGARCIA [...] cpan.org
Requestors: khedin [...] cpan.org
Cc: khedin [...] cpan.org
ether [...] cpan.org
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: 0.07



CC: khedin [...] mail.ru
Subject: [wishlist] Also report original source line number
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.
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.
Implemented in 0.07.