Acme-AutoLoad
view release on metacpan or search on metacpan
lib/Acme/AutoLoad.pm view on Meta::CPAN
}
mkbase($cache_file) or die "$cache_file: Unable to create! $!\n";
shift @INC if $INC[0] eq \&ignore;
if ($f =~ m{^(([\w/]+)\.pm)}) {
my $dist = my $mod = $2;
$f = $1;
$dist =~ s{/+}{-}g;
$mod =~ s{/+}{::}g;
my $mapper = $ENV{AUTOLOAD_SRC} || "http://fastapi.metacpan.org/v1/module";
my $search = fetch("$mapper/$mod/");
warn "DEBUG: Probed: $last_fetched\n" if $ENV{AUTOLOAD_DEBUG};
if ($search =~ m{download_url.*?(\w+/[\w\-\.]+)\.tar.gz}) {
my $src = full("/source/$1/");
if ($search =~ m{"distribution"\s*:\s*"(.*?)"} && $dist ne $1) {
warn "DEBUG: Found module [$mod] as part of [$1] instead of [$dist]\n" if $ENV{AUTOLOAD_DEBUG};
$dist = $1;
}
if (my $MANIFEST = fetch "$src/MANIFEST") {
$src = $1 if $last_fetched =~ m{^(.*?)/+MANIFEST};
if ($MANIFEST =~ m{^lib/}m) {
lib/Acme/AutoLoad.pm view on Meta::CPAN
=head2 AUTOLOAD_DEBUG
You can enable verbose debugging to see more how it works or
if you are having trouble with some modules by setting
AUTOLOAD_DEBUG to a true value.
The default is off.
=head2 AUTOLOAD_SRC
You can use AUTOLOAD_SRC to specify the mapper engine to ask where the latest location of the module is.
# For example
BEGIN { $ENV{AUTOLOAD_SRC} = "http://metacpan.org/release"; }
The default is "http://fastapi.metacpan.org/v1/module"
=head2 NETWORK_TEST_ACME_AUTOLOAD
In order to really test the test suite, the NETWORK_TEST_ACME_AUTOLOAD
environment variable must be set to a true value, otherwise none of the
( run in 1.179 second using v1.01-cache-2.11-cpan-39bf76dae61 )