in reply to extracting subroutine names (together with their packages) via PPI

PPI, and therefore Devel::Examine::Subs is file based. They don't have the concept of packages at all.

To do this properly, you'd have to read a file until you find a package token, then slurp up all subs until you hit the next package.

All of my software uses one package per file, so its trivial to transform the package name from the file and path. If you have multiple packages per file and want to know which subs are in each package, you'll have create your own routine as I suggested above.

  • Comment on Re: extracting subroutine names (together with their packages) via PPI
  • Download Code