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.
The first post will be about the doc subcommand, new in lcpan 0.69. This can be used to view POD documentation for CPAN modules or scripts, even those that are not installed on your system:
% lcpan doc Win32::HTA % lcpan doc meta ;# view script documentation
There are a few options available. First, sometimes there’s both the .pm and .pod (one such case: PSGI.pod and PSGI.pm, and the doc is in .pod). lcpan will sometimes guess incorrectly which one you want, so to choose specifically the .pod or .pm:
% lcpan doc PSGI.pod % lcpan doc PSGI.pm
Also, there might be cases where a script name is the same as module name. By default, the module will be chosen first. To specifically choose script, use
To dump the raw version instead of rendering the POD, use
% lcpan PSGI.pm -r