PFUNC(1p)
β¨ PFUNC(1p) β¨
okay so this is pfunc, a lil script from the User Contributed Perl Documentation corner of the perl world, and bestie it does exactly one thing and it does it so well π
πΈ NAME πΈ
pfunc β it's literally grep, but for perl functions π¦
π SYNOPSIS π
pfunc subroutine FILES...
that's it. that's the whole vibe. π
π DESCRIPTION π
so here's the tea β β pfunc goes through all the named FILES you hand it and hunts down every single call to the subroutine you asked about. then it reports back the file and the line number each call lives on, plus what sort of call it is, because not all calls are built the same, periodt π
the three flavours it knows about:
function foo()
class method Class->foo()
object method $obj->foo()
function call, class method, object method β it clocks all three, no cap π΅οΈβοΈ
π EXAMPLE π
here's a real one, look how pretty the output is:
$ pfunc isa /usr/share/perl/5.6.1/*.pm
Called as function in /usr/share/perl/5.6.1/CGI.pm at line 316
Called as function in /usr/share/perl/5.6.1/CGI.pm at line 327
Called as function in /usr/share/perl/5.6.1/CGI.pm at line 397
Called as function in /usr/share/perl/5.6.1/CGI.pm at line 494
Called as function in /usr/share/perl/5.6.1/CGI.pm at line 495
Called as object method in /usr/share/perl/5.6.1/CPAN.pm at line 4957
Called as function in /usr/share/perl/5.6.1/Dumpvalue.pm at line 191
Called as function in /usr/share/perl/5.6.1/Dumpvalue.pm at line 218
Called as function in /usr/share/perl/5.6.1/Dumpvalue.pm at line 248
Called as function in /usr/share/perl/5.6.1/Dumpvalue.pm at line 251
Called as function in /usr/share/perl/5.6.1/Dumpvalue.pm at line 254
Called as object method in /usr/share/perl/5.6.1/Shell.pm at line 28
Called as object method in /usr/share/perl/5.6.1/base.pm at line 12
see how it tells you how it's being called every time? Called as function vs Called as object method β chef's kiss ππ that's the whole point, iykyk
π«Ά NOTES π«Ά
ngl, it's not fast β like, at all. but it's accurate and honestly? we respect the honesty. π’β¨
lowkey the whole personality of this tool is "slow but correct" and i'm obsessed
π AUTHOR π
Michael G Schwern <schwern@pobox.com> β thank you for your service legend π«‘π
π¦ SEE ALSO π¦
Module::Info
and that's a wrap, bestie!! πΈ this page came to you from perl v5.40.0, dated 2024-08-29, filed under PFUNC(1p). go forth and grep your subroutines, you absolute main character π
ππ¦
π¦ where this page comes from
- ubuntu resolute: libmodule-info-perl 0.39-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmodule-info-perl 0.39-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms