Perl Documentation

Perl has copious documentation in Plain Old Documentation (POD) format. Knowing where to look for this documentation will benefit anyone doing Perl programming. Try perlmeme.org or PerlMonks for Perl code examples.

Note that online versions of the documentation may not match the version of Perl or the module installed locally. This could cause bugs due to the wrong documentation being read. I strongly recommend that local documentation be used in preference to online resources.

Use the perldoc command to access the Perl documentation. For instance, for general information about perl and an index of other documentation, run:

$ perldoc perl

If perldoc(1) is not available, access the Perl documentation on the web (with the usual caveat that this documentation may not match the version installed locally). Some Unix vendors do not install the documentation with perl. On Debian, install the perl-doc package:

# apt-get install perl-doc

On Mac OS X, install Xcode (formerly known as Developer?s Tools). Recent Mac OS X (10.6) ship with multiple versions of perl. This may require appending a version number to find the appropriate documentation:

Lookup questions in the perlfaq documents with the -q option to perldoc:

$ perldoc -q lock?

However, the FAQ Keyword lookup often requires one to know what the title of the FAQ entry is before being able to craft an appropriate keyword lookup. podgrep from the pmtools suite may offer better search results, or consider the Perl Cookbook.

Use the ow script to expand URL on the command line, or create a ?Quick Search? location bar expansion http://search.cpan.org/perldoc/%s, as supported by many web browsers. ow will pass the URL to a browser by default, or display the URL for manual copying:

$ ow -l perldoc SOAP::Litehttp://search.cpan.org/perldoc/SOAP::Lite

However, note that online versions of the documentation may not match the version of the module installed on the system. This could lead to errors or bugs. I strongly recommend that the local documentation be used.