Parse::CPAN::Authors - Parse 01mailrc.txt.gz
use Parse::CPAN::Authors; # must have downloaded my $p = Parse::CPAN::Authors->new("01mailrc.txt.gz"); # either a filename as above or pass in the contents of the file my $p = Parse::CPAN::Authors->new($mailrc_contents); my $author = $p->author('LBROCARD'); # $a is a Parse::CPAN::Authors::Author object # ... objects are returned by Parse::CPAN::Authors print $author->email, "\n"; # leon@astray.com print $author->name, "\n"; # Leon Brocard print $author->pauseid, "\n"; # LBROCARD # all the author objects my @authors = $p->authors;
The Comprehensive Perl Archive Network (CPAN) is a very useful collection of Perl code. It has several indices of the files that it hosts, including a file named "01mailrc.txt.gz" in the "authors" directory. This file contains lots of useful information on CPAN authors and this module provides a simple interface to the data contained within.
Note that this module does not concern itself with downloading this file. You should do this yourself.
The new() method is the constructor. It takes either the path to the 01mailrc.txt.gz file or its contents. It defaults to loading the file from the current directory. You must download it yourself.
# must have downloaded my $p = Parse::CPAN::Authors->new("01mailrc.txt.gz"); # either a filename as above or pass in the contents of the file my $p = Parse::CPAN::Authors->new($mailrc_contents);
The author() method returns a Parse::CPAN::Authors::Author object representing a user:
my $author = $p->author('LBROCARD');
The authors() method returns a list of Parse::CPAN::Authors::Author objects, for each author on CPAN:
my @authors = $p->authors;
Leon Brocard <acme@astray.com>
Copyright (C) 2004, Leon Brocard
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
To install Parse::CPAN::Authors, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parse::CPAN::Authors
CPAN shell
perl -MCPAN -e shell install Parse::CPAN::Authors
For more information on module installation, please visit the detailed CPAN module installation guide.