On Wed, Jul 06, 2016 at 04:21:55AM -0700, Florido Paganelli wrote:
> Hi TIm, all
Hi Florido.
Ignoring clunky/impractical for now, does that code work for you?
> What is the best way to achieve the above in the code?
The above doesn't look like much code so if it works then I'm not clear
what your specific concerns are.
> Getting stats for subroutines and lines of code directly?
Isn't that what you've done above?
> Can you show me an example? The csv and html readers are not interesting.
> They parse everything. It is not what I need.
At their core they iterate over lines and subroutines and output data
for each. Some digging past the code doing the iteration should yield
some useful code snippits.
For subroutines, there's a module that provides a more abstract API:
https://metacpan.org/source/TIMB/Devel-NYTProf-6.03/lib/Devel/NYTProf/SubInfo.pm#
and a similar one for files:
https://metacpan.org/source/TIMB/Devel-NYTProf-6.03/lib/Devel/NYTProf/FileInfo.pm#
Using those avoids the need to break encapsulation.
I've not touched the code for a while so I'm rusty on the details. Sorry.
More specific questions might get more useful answers :)
Tim.