Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (17 sloc) 0.659 kb
name 'query_mirror';
description "mst's hack to get redirects by module name on CPAN mirrors";
author 'Tatsuhiko Miyagawa';
api_version 0.1;
my $mirror = "";
hook search_module => sub {
my $args = shift;
return unless $args->{module} =~ /^[A-Za-z0-9_:]+$/;
my $app = $args->{app};
push @{$args->{uris}}, sub {
$app->chat("Querying $args->{module} with by-module against $mirror\n");
my $uri = $app->redirect("$mirror/by-module/$args->{module}");
return $uri if $uri;
$app->chat("! Finding $args->{module} with by-module failed.\n");
Jump to Line
Something went wrong with that request. Please try again.