I need a list of all the subs brought in by the file, not all the subs in the current or main package
You could compare the list of functions before and after requiring the file:
### file.pm sub funcC { } sub funcD { } sub funcE { } 1; ### main script #!/usr/bin/perl use strict; use warnings; use Devel::Symdump; sub funcA { } sub funcB { } sub get_functions { return Devel::Symdump->functions("main"); } my %before = map {$_ => 1} get_functions(); require 'file.pm'; print "$_\n" for sort grep !$before{$_}, get_functions(); __END__ main::funcC main::funcD main::funcE
In reply to Re: List of subs defined by a file?
by almut
in thread List of subs defined by a file?
by exodist
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |