1Parse::BACKPAN::PackageUss(e3r)Contributed Perl DocumentPaatrisoen::BACKPAN::Packages(3)
2
3
4
6 Parse::BACKPAN::Packages - Provide an index of BACKPAN
7
9 use Parse::BACKPAN::Packages;
10 my $p = Parse::BACKPAN::Packages->new();
11 print "BACKPAN is " . $p->size . " bytes\n";
12
13 my @filenames = keys %$p->files;
14
15 # see Parse::BACKPAN::Packages::File
16 my $file = $p->file("authors/id/L/LB/LBROCARD/Acme-Colour-0.16.tar.gz");
17 print "That's " . $file->size . " bytes\n";
18
19 # see Parse::BACKPAN::Packages::Distribution
20 my @acme_colours = $p->distributions("Acme-Colour");
21
22 my @authors = $p->authors;
23 my @acmes = $p->distributions_by('LBROCARD');
24
26 The Comprehensive Perl Archive Network (CPAN) is a very useful
27 collection of Perl code. However, in order to keep CPAN relatively
28 small, authors of modules can delete older versions of modules to only
29 let CPAN have the latest version of a module. BACKPAN is where these
30 deleted modules are backed up. It's more like a full CPAN mirror, only
31 without the deletions. This module provides an index of BACKPAN and
32 some handy functions.
33
34 The data is fetched from the net and cached for an hour.
35
37 new
38 The constructor downloads a ~1M index file from the web and parses it,
39 so it might take a while to run:
40
41 my $p = Parse::BACKPAN::Packages->new();
42
43 authors
44 The authors method returns a list of all the authors. This is meant so
45 that you can pass them into the distributions_by method:
46
47 my @authors = $p->authors;
48
49 distributions
50 The distributions method returns a list of objects representing all the
51 different versions of a distribution:
52
53 # see Parse::BACKPAN::Packages::Distribution
54 my @acme_colours = $p->distributions("Acme-Colour");
55
56 distributions_by
57 The distributions_by method returns a list of distribution names
58 representing all the distributions that an author has uploaded:
59
60 my @acmes = $p->distributions_by('LBROCARD');
61
62 file
63 The file method finds metadata relating to a file:
64
65 # see Parse::BACKPAN::Packages::File
66 my $file = $p->file("authors/id/L/LB/LBROCARD/Acme-Colour-0.16.tar.gz");
67 print "That's " . $file->size . " bytes\n";
68
69 files
70 The files method returns a hash reference where the keys are the
71 filenames of the files on CPAN and the values are
72 Parse::BACKPAN::Packages::File objects:
73
74 my @filenames = keys %$p->files;
75
76 size
77 The size method returns the sum of all the file sizes in BACKPAN:
78
79 print "BACKPAN is " . $p->size . " bytes\n";
80
82 Leon Brocard <acme@astray.com>
83
85 Copyright (C) 2005-9, Leon Brocard
86
88 This module is free software; you can redistribute it or modify it
89 under the same terms as Perl itself.
90
92 CPAN::DistInfoname, Parse::BACKPAN::Packages::File,
93 Parse::BACKPAN::Packages::Distribution, Parse::CPAN::Packages.
94
95
96
97perl v5.12.0 2009-06-27 Parse::BACKPAN::Packages(3)