CPAN::PackageDetails

Create or read 02packages.details.txt.gz
Download

CPAN::PackageDetails Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • brian d foy
  • Publisher web site:
  • http://search.cpan.org/~bdfoy/

CPAN::PackageDetails Tags


CPAN::PackageDetails Description

Create or read 02packages.details.txt.gz Using the CPAN::PackageDetails Perl module, you can get a data structure of that file, or create your own.CPAN uses an index file, 02packages.details.txt.gz, to map package names to distribution files. Using the CPAN::PackageDetails Perl module, you can get a data structure of that file, or create your own.There are two parts to the 02packages.details.txt.gz: a header and the index. This module uses a top-level CPAN::PackageDetails object to control everything and comprise an CPAN::PackageDetails::Header and CPAN::PackageDetails::Entries object. The CPAN::PackageDetails::Entries object is a collection of CPAN::PackageDetails::Entry objects.For the most common uses, you don't need to worry about the insides of what class is doing what. You'll call most of the methods on the top-level CPAN::PackageDetails object and it will make sure that it gets to the right place.SYNOPSIS use CPAN::PackageDetails; # read an existing file ##################### my $package_details = CPAN::PackageDetails->read( $filename ); my $count = $package_details->count; my $records = $package_details->entries; foreach my $record ( @$records ) { # See CPAN::PackageDetails::Entry too print join " ", map { $record->$_() } ('package name', 'version', 'path') print join " ", map { $record->$_() } $package_details->columns_as_list; } # not yet implemented, but would be really, really cool eh? my $records = $package_details->entries( logic => 'OR', # but that could be AND, which is the default package => qr/^Test::/, # or a string author => 'OVID', # case insenstive path => qr/foo/, ); # create a new file ##################### my $package_details = CPAN::PackageDetails->new( file => "02packages.details.txt", url => "http://example.com/MyCPAN/modules/02packages.details.txt", description => "Package names for my private CPAN", columns => "package name, version, path", intended_for => "My private CPAN", written_by => "$0 using CPAN::PackageDetails $CPAN::PackageDetails::VERSION", last_updated => CPAN::PackageDetails->format_date, allow_packages_only_once => 1, ); $package_details->add_entry( package_name => $package, version => $package->VERSION; path => $path, ); print "About to write ", $package_details->count, " entries "; $package_details->write_file( $file ); $package_details->write_fh( *STDOUT ) Requirements: · Perl


CPAN::PackageDetails Related Software