1N/A # Sloppy Unix path normalization. 1N/A # File::Find does not know how to deal with VMS filepaths. 1N/A # Read the core packlist 1N/A # Read the module packlists 1N/A # Only process module .packlists 1N/A # Hack of the leading bits of the paths & convert to a module name 1N/A # Find the top-level module file in @INC 1N/A # Read the .packlist 1N/A# VMS's non-case preserving file-system means the package name can't 1N/A# be reconstructed from the filename. 1N/A if (/
package\s+(\S+)\s*;/) {
1N/A # Make a sanity check, that lower case $module 1N/A # is identical to lowercase $pack before 1N/A print STDERR "Couldn't figure out the package name for $file\n" 1N/A # Validate arguments 1N/A Carp::
croak(
'type must be "all", "prog" or "doc"')
1N/AExtUtils::Installed - Inventory management of installed modules 1N/A use ExtUtils::Installed; 1N/A my ($inst) = ExtUtils::Installed->new(); 1N/A my (@modules) = $inst->modules(); 1N/A my (@missing) = $inst->validate("DBI"); 1N/A my $all_files = $inst->files("DBI"); 1N/A my $files_below_usr_local = $inst->files("DBI", "all", "/usr/local"); 1N/A my $all_dirs = $inst->directories("DBI"); 1N/A my $dirs_below_usr_local = $inst->directory_tree("DBI", "prog"); 1N/A my $packlist = $inst->packlist("DBI"); 1N/AExtUtils::Installed provides a standard way to find out what core and module 1N/Afiles have been installed. It uses the information stored in .packlist files 1N/Acreated during installation to provide this information. In addition it 1N/Aprovides facilities to classify the installed files and to extract directory 1N/Ainformation from the .packlist files. 1N/AThe new() function searches for all the installed .packlists on the system, and 1N/Astores their contents. The .packlists can be queried with the functions 1N/AThis takes no parameters, and searches for all the installed .packlists on the 1N/Asystem. The packlists are read using the ExtUtils::packlist module. 1N/AThis returns a list of the names of all the installed modules. The perl 'core' 1N/Ais given the special name 'Perl'. 1N/AThis takes one mandatory parameter, the name of a module. It returns a list of 1N/Aall the filenames from the package. To obtain a list of core perl files, use 1N/Athe module name 'Perl'. Additional parameters are allowed. The first is one 1N/Aof the strings "prog", "doc" or "all", to select either just program files, 1N/Ajust manual files or all files. The remaining parameters are a list of 1N/Adirectories. The filenames returned will be restricted to those under the 1N/Aspecified directories. 1N/AThis takes one mandatory parameter, the name of a module. It returns a list of 1N/Aall the directories from the package. Additional parameters are allowed. The 1N/Afirst is one of the strings "prog", "doc" or "all", to select either just 1N/Aprogram directories, just manual directories or all directories. The remaining 1N/Aparameters are a list of directories. The directories returned will be 1N/Arestricted to those under the specified directories. This method returns only 1N/Athe leaf directories that contain files from the specified module. 1N/A=item directory_tree() 1N/AThis is identical in operation to directories(), except that it includes all the 1N/Aintermediate directories back up to the specified directories. 1N/AThis takes one mandatory parameter, the name of a module. It checks that all 1N/Athe files listed in the modules .packlist actually exist, and returns a list of 1N/Aany missing files. If an optional second argument which evaluates to true is 1N/Agiven any missing files will be removed from the .packlist 1N/AThis returns the ExtUtils::Packlist object for the specified module. 1N/AThis returns the version number for the specified module. 1N/ASee the example in L<ExtUtils::Packlist>. 1N/AAlan Burlison <Alan.Burlison@uk.sun.com>