Ticket #471 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

Ecliptic Quick Module Access should use CPAN::SQLite::Search

Reported by: azawawi Owned by: azawawi
Priority: major Milestone:
Component: plugins Version: 0.39
Keywords: Padre::Plugin::Ecliptic Cc:

Description

Whenever there is a CPAN::SQLite database, it can be used to query modules instead of the slow ExtUtils::Installed


use strict;
use warnings;

use CPAN::Config;

my $cpan_home = $CPAN::Config->{cpan_home};
print $cpan_home . "\n";

my $db_dir = $cpan_home;
my $db_name = 'cpandb.sql';
my $max_results = 10000;
require CPAN::SQLite::Search;
my $query = CPAN::SQLite::Search->new(

db_dir => $db_dir,
db_name => $db_name,
max_results => $max_results

);
$query->query(mode => 'module', name => 'mod_name', query => 'Perl6::.+$');
my $results = $query->{results};
my @result = @{$query->{results}};
foreach my $result (@results) {

#print $result->{mod_name} . "\n";

}

print "done reading" . scalar @modules ."!\n";

Change History

comment:1 Changed 4 years ago by azawawi

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r9750

No need to use CPAN::SQLite::Search as it is too slow compared to a regular-Find-@INC pm-files-and-filter solution.... :)

Note: See TracTickets for help on using tickets.