PPIx::LineToSub - Find the package and subroutine by line
use PPIx::LineToSub; my $document = PPI::Document->new('t/hello.pl'); $document->index_line_to_sub; my($package, $sub) = $document->line_to_sub(1);
PPIx::LineToSub is a module which, given a Perl file and a line number, will return the package and sub in effect.
PPI.
Leon Brocard, <acme@astray.com>
<acme@astray.com>
Copyright (C) 2008, Leon Brocard
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
To install PPI::Document, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PPI::Document
CPAN shell
perl -MCPAN -e shell install PPI::Document
For more information on module installation, please visit the detailed CPAN module installation guide.