1 package Acme::CPANAuthors::You::re_using;
8 use ExtUtils::Installed;
10 use Acme::CPANAuthors::Utils;
14 Acme::CPANAuthors::You::re_using - We are the CPAN authors that have written the modules installed on your perl!
29 use Acme::CPANAuthors;
31 my $authors = Acme::CPANAuthors->new("You're_using");
32 print $authors->name($_) . " ($_)\n" for $authors->id;
36 This module builds an L<Acme::CPANAuthors> class by listing all the modules that are installed on the current C<perl> and then retrieving the name and the PAUSE id of their corresponding authors.
38 It may take some time to load since it has to search all the directory trees given by your C<@INC> for modules, but also to get and parse CPAN indexes.
44 Fetches and registers the names into L<Acme::CPANAuthors::Register>.
45 This function is automatically called when you C<use> this module, unless you have set the package variable C<$Acme::CPANAuthors::You're_using::SKIP> to true beforehand.
49 BEGIN { require Acme::CPANAuthors::Register; }
56 my $pkgs = Acme::CPANAuthors::Utils::cpan_packages();
57 croak 'Couldn\'t retrieve a valid Parse::CPAN::Packages object' unless $pkgs;
59 my $auths = Acme::CPANAuthors::Utils::cpan_authors();
60 croak 'Couldn\'t retrieve a valid Parse::CPAN::Authors object' unless $auths;
62 my $installed = ExtUtils::Installed->new(extra_libs => \@INC);
63 croak 'Couldn\'t create a valid ExtUtils::Installed object' unless $installed;
65 for ($installed->modules) {
66 next unless defined and $_ ne 'Perl';
68 my $mod = $pkgs->package($_);
71 my $dist = $mod->distribution;
74 my $cpanid = $dist->cpanid;
75 next if not $cpanid or exists $authors{$cpanid};
77 my $auth = $auths->author($cpanid);
80 $name = $auth->name if defined $auth;
82 $authors{$cpanid} = defined $name ? $name : $cpanid;
85 Acme::CPANAuthors::Register->import(%authors);
90 BEGIN { register($SKIP) }
94 L<Carp>, L<ExtUtils::Installed>, L<Acme::CPANAuthors>.
98 All others C<Acme::CPANAuthors::*> modules.
102 Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
104 You can contact me by mail or on C<irc.perl.org> (vincent).
108 Please report any bugs or feature requests to C<bug-acme-cpanauthors-you-re_using at rt.cpan.org>, or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-CPANAuthors-You-re_using>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
112 You can find documentation for this module with the perldoc command.
114 perldoc Acme::CPANAuthors::You::re_using
116 =head1 COPYRIGHT & LICENSE
118 Copyright 2009 Vincent Pit, all rights reserved.
120 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.