Devel::...ileInfo(3)
π NAME π
Devel::NYTProf::FileInfo β bestie, this is the one, straight out of the User Contributed Perl Documentation manual. Say hi to the module, she's iconic. π
β¨ METHODS β¨
πΈ sub_call_lines πΈ
$hash = $fi->sub_call_lines;
Okay so this hands you back a reference to a hash stuffed with info about subroutine calls made at individual lines inside the source file. And if there's no subroutine calling info to be found? It gives you undef. No data, no drama. π
The keys of that returned hash are line numbers. The values are references to hashes that use fully qualified subroutine names as their keys. And each of those hash values is a reference to an array holding two things:
- an integer call count β like, how many times the sub was called from that line of that file
- an inclusive time β how much time was spent inside the sub when it was called from that line of that file
Let's make it real. Say this was line 42 of a file called foo.pl:
++$wiggle if foo(24) == bar(42);
That line got executed once, and foo and bar were imported from pkg1. Then sub_call_lines() would return something like:
{
42 => {
'pkg1::foo' => [ 1, 0.02093 ],
'pkg1::bar' => [ 1, 0.00154 ],
},
}
See how it all lines up? 42 β the line. pkg1::foo β [ count, time ]. Chef's kiss. π
π¦ evals_by_line π¦
# { line => { fid_of_eval_at_line => $fi, ... }, ... }
$hash = $fi->evals_by_line;
This one returns a reference to a hash carrying info about string evals executed at individual lines within a source file. String evals, bestie. They're out here living on their own lines. π
The keys of the returned hash are line numbers. The values are references to hashes where the keys are file id integers and the values are FileInfo objects.
And that's the whole page. Two methods, zero fluff, all facts intact. π
perl v5.42.0 Β· 2025-07-25 β mwah, that's a wrap on this User Contributed Perl Documentation moment. Go forth and profile, bestie. π«Άβ¨πΈ
π¦ where this page comes from
- fedora 43: perl-Devel-NYTProf 6.14-8.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms