]> git.vpit.fr Git - perl/modules/Acme-CPANAuthors-You-re_using.git/blobdiff - lib/Acme/CPANAuthors/You/re_using.pm
This is 0.02
[perl/modules/Acme-CPANAuthors-You-re_using.git] / lib / Acme / CPANAuthors / You / re_using.pm
index 785b614d0b89e6bea334e0ec39c90205086c3f8f..6675784681a3b551dd6103fe0761f0f06830e004 100644 (file)
@@ -15,13 +15,13 @@ Acme::CPANAuthors::You::re_using - We are the CPAN authors that have written the
 
 =head1 VERSION
 
-Version 0.01
+Version 0.02
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.01';
+ $VERSION = '0.02';
 }
 
 =head1 SYNOPSIS
@@ -35,11 +35,22 @@ BEGIN {
 
 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.
 
-It may take some time to load since it has to get CPAN indexes at C<BEGIN> time.
+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.
+
+=head1 FUNCTIONS
+
+=head2 C<register>
+
+Fetches and registers the names into L<Acme::CPANAuthors::Register>.
+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.
 
 =cut
 
-BEGIN {
+BEGIN { require Acme::CPANAuthors::Register; }
+
+sub register {
+ return if shift;
+
  my %authors;
 
  my $pkgs = Acme::CPANAuthors::Utils::cpan_packages();
@@ -71,10 +82,13 @@ BEGIN {
   $authors{$cpanid} = defined $name ? $name : $cpanid;
  }
 
- require Acme::CPANAuthors::Register;
  Acme::CPANAuthors::Register->import(%authors);
 }
 
+our $SKIP;
+
+BEGIN { register($SKIP) }
+
 =head1 DEPENDENCIES
 
 L<Carp>, L<ExtUtils::Installed>, L<Acme::CPANAuthors>.