PFUNC(1p)

πŸ“¦
version 0.39 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ 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