http://www.pobox.com/~schwern/src/Module-Info-0.07.tar.gz
New version of Module::Info. I figured out how to implement
subroutines(). This uses the backend compiler and isn't subject to
the caveats of a regex based one. If there's a subroutine defined
when the module loads, it'll find it.
In other news, anyone familiar with the guts of the B::Deparse module
contact me, I need help implementing modules_used().
subroutines
my %subs = $module->subroutines;
Returns a hash of all subroutines defined inside this
module and some info about it. The key is the *full*
name of the subroutine (ie. $subs{'Some::Module::foo'}
rather than just $subs{'foo'}), value is a hash ref
with information about the subroutine like so:
start => line number of the first statement in the subroutine
end => line number of the last statement in the subroutine
Note that the line numbers may not be entirely accu-
rate and will change as perl's backend compiler
improves. They typically correspond to the first and
last run-time statements in a subroutine. For exam-
ple:
sub foo {
package Wibble;
$foo = "bar";
return $foo;
}
Taking "sub foo {" as line 1, Module::Info will report
line 3 as the start and line 4 as the end. "package
Wibble;" is a compile-time statement. Again, this
will change as perl changes.
Note this only catches simple "sub foo {...}" subrou-
tine declarations. Anonymous, autoloaded or eval'd
subroutines are not listed.
0.07 Mon Dec 10 11:09:40 EST 2001
* Implemented subroutines(). Need help getting modules_used() done.
- Fixed up $B::Utils::file/line handling in B::Utils.
0.06 Sat Nov 24 20:45:15 EST 2001
* Implemented packages_inside(). Need help getting the rest done.
- Distributing a hacked up version of B::Utils until the main
distribution gets fixed.
0.05 Fri Nov 23 18:06:22 EST 2001
- Rafael Garcia-Suarez noticed I forgot to deal with code refs in
@INC. The plan is to just skip them until someone notices.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
Perl Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One
Anti-cow device, don't bother.
http://www.goats.com/archive/990323.html