lcpan tips 002: Install CPAN distribution when you only know a script’s name

About this series: a collection of short, daily blog posts about lcpan tips/recipes. Some posts will also end up in the upcoming App::lcpan::Manual::Cookbook POD to be included in the App-lcpan distribution.

About lcpan: an application to download and index a mini CPAN mirror on your local filesystem, so in effect you will have something like your own CPAN with a command-line tool (or perl API) to query and extract information from your mirror. I find it perfect for my own personal use when working offline.

A CPAN distribution can contain scripts in addition to modules. Sometimes you only remember the name of the script but not the module/dist name, so there is a difficulty (read: an additional Google search) to install the script from CPAN because CPAN clients normally expect module/dist name. lcpan to the rescue: a script2mod (as well as script2dist, script2rel) is provided to find out the name of CPAN module for a known script. So you can install module with:

% cpanm -n `lcpan script2mod pm-uninstall`
% cpanm -n `lcpan script2mod pmuninst`
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s