lcpan tips 001: doc

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 -s (--script).

To dump the raw version instead of rendering the POD, use -r (--raw):

% lcpan PSGI.pm -r
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