Using search.cpan.org AND metacpan

I appreciate the effort and openness of metacpan, but their search is still pretty bad. To be clear, compare the results of the search for DBIx:Class::Source on SCO and metacpan. That’s why I made the following greasemonkey/dotjs script:

$('a').each(function(i,x){
   var obj = $(this);
   var href = obj.attr('href');
   var re = new RegExp('^/~([^/]+)/(.*)$');
   this.href = href.replace(re, 'https://metacpan.org/module/$1/$2');
})

Put this in ~/.js/search.cpan.org.js to install it with dotjs. Feel free to extend it to work for more than just modules.

Posted Wed, May 16, 2012

If you're interested in being notified when new posts are published, you can subscribe here; you'll get an email once a week at the most.