Query: module::extract::use
OS: debian
Section: 3pm
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Module::Extract::Use(3pm) User Contributed Perl Documentation Module::Extract::Use(3pm)NAMEModule::Extract::Use - Pull out the modules a module usesSYNOPSISuse Module::Extract::Use; my $extor = Module::Extract::Use->new; my @modules = $extor->get_modules( $file ); if( $extor->error ) { ... } my @details = $extor->get_modules_with_details( $file ); foreach my $detail ( @details ) { printf "%s %s imports %s ", $detail->module, $detail->version, join ' ', @{ $detail->imports } }DESCRIPTIONExtract the names of the modules used in a file using a static analysis. Since this module does not run code, it cannot find dynamic uses of modules, such as "eval "require $class"". new Makes an object. The object doesn't do anything just yet, but you need it to call the methods. init Set up the object. You shouldn't need to call this yourself. get_modules( FILE ) Returns a list of namespaces explicity use-d in FILE. Returns undef if the file does not exist or if it can't parse the file. Each used namespace is only in the list even if it is used multiple times in the file. The order of the list does not correspond to anything so don't use the order to infer anything. get_modules_with_details( FILE ) Returns a list of hash references, one reference for each namespace explicitly use-d in FILE. Each reference has keys for: namespace - the namespace, always defined version - defined if a module version was specified imports - an array reference to the import list Each used namespace is only in the list even if it is used multiple times in the file. The order of the list does not correspond to anything so don't use the order to infer anything. error Return the error from the last call to "get_modules".TO DOo Make it recursive, so it scans the source for any module that it finds.SEE ALSOModule::ScanDepsSOURCE AVAILABILITYThe source code is in Github: git://github.com/briandfoy/module-extract-use.gitAUTHORbrian d foy, "<bdfoy@cpan.org>"COPYRIGHT AND LICENSECopyright (c) 2008-2011, brian d foy, All Rights Reserved. You may redistribute this under the same terms as Perl itself. perl v5.10.1 2011-03-31 Module::Extract::Use(3pm)
Related Man Pages |
---|
pm_which(1p) - debian |
module::extract::use(3pm) - debian |
module::util(3pm) - debian |
template::base(3pm) - debian |
universal::require(3pm) - debian |
Similar Topics in the Unix Linux Community |
---|
Extract string from multiple file based on line count number |
Extract Specific Information from a particular field |