From: Vincent Pit Date: Tue, 17 Feb 2009 16:56:00 +0000 (+0100) Subject: Put all the name fetching and registering into a proper sub X-Git-Tag: v0.02~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FAcme-CPANAuthors-You-re_using.git;a=commitdiff_plain;h=7dba09fe789dac966ec4609e199557c7c622baf9 Put all the name fetching and registering into a proper sub --- diff --git a/lib/Acme/CPANAuthors/You/re_using.pm b/lib/Acme/CPANAuthors/You/re_using.pm index 09db1de..5d3932f 100644 --- a/lib/Acme/CPANAuthors/You/re_using.pm +++ b/lib/Acme/CPANAuthors/You/re_using.pm @@ -37,12 +37,19 @@ This module builds an L class by listing all the modules that 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 + +Fetches and registers the names into L. +This function is automatically called when you C this module, unless you have set the package variable C<$Acme::CPANAuthors::You're_using::SKIP> to true beforehand. + =cut -our $SKIP; +BEGIN { require Acme::CPANAuthors::Register; } -BEGIN { - return if $SKIP; +sub register { + return if shift; my %authors; @@ -75,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, L, L.