in reply to cli to cpan search?
Actually, it can be as easy as:
Add some option handling and argument checking and you are done!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;
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
|
---|