in reply to cli to cpan search?

the cpan shell can do it, so it should not be too difficult to lift that part out of the code and incorporate it into a cpansearch script.

Actually, it can be as easy as:

package main; use strict; use warnings; use Modern::Perl; use CPAN; CPAN::HandleConfig->load; CPAN::Shell::setup_output; CPAN::Index->reload; my $search = shift @ARGV; my @modules = CPAN::Shell->expand("Module","/$search/"); say CPAN::Module::as_glimpse($_) for @modules; 1;
Add some option handling and argument checking and you are done!

Update: added an example script.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James