The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Abstract

p5find-sub is a program to find subroutine definitions in your perl5 code. When invoked, it simply prints the location all subroutines, including the name-less ones.

Examples

Here is a partial result for perlbrew repository:

    > p5find-sub lib | head
    lib/App/Perlbrew/Path/Installation.pm:11:sub name {
    lib/App/Perlbrew/Path/Installation.pm:15:sub bin {
    lib/App/Perlbrew/Path/Installation.pm:19:sub man {
    lib/App/Perlbrew/Path/Installation.pm:23:sub perl {
    lib/App/Perlbrew/Path/Installation.pm:27:sub version_file {
    lib/App/Perlbrew/Path/Installations.pm:12:sub child {
    lib/App/Perlbrew/Path/Installations.pm:22:sub children {
    lib/App/Perlbrew/Path/Installations.pm:26:sub list {
    lib/App/Perlbrew/Path/Root.pm:12:sub bin {
    lib/App/Perlbrew/Path/Root.pm:16:sub build {

To find a subroutine by its name, pass the name with --name parameter:

    > p5find-sub --name do_install_this lib
    lib/App/perlbrew.pm:1706:sub do_install_this {