Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (22 sloc) 936 Bytes
name 'cpanidx';
description 'query CPAN IDX rather than scraping';
author 'Tatsuhiko Miyagawa';
api_version 0.1;
# This is a proof-of-concept plugin:
# DO NOT USE THIS PLUGIN - the server hardcoded here is not frequently updated
hook search_module => sub {
my $args = shift;
return unless $args->{module} =~ /^[A-Za-z0-9_:]+$/;
push @{$args->{uris}}, sub {
require YAML;
$args->{app}->chat("Querying CPANIDX for $args->{module}\n");
my $yaml = $args->{app}->get("$args->{module}");
my $meta = (YAML::Load($yaml))[0];
if (my $d = $meta->[0]) {
$args->{app}->chat("Got a response from CPANIDX => $d->{dist_file}\n");
return $args->{app}->cpan_uri($d->{dist_file});
$args->{app}->chat("! Finding $args->{module} on cpanidx failed.\n");
Something went wrong with that request. Please try again.