Perl comes with its own documentation. The most straightforward and widely preferred way to read it is by means of the perldoc command line utility. It will give access to specific perl manpages (e.g.: perlsyn for Perl syntax or perlop for Perl operators) as well as to the documentation for individual functions and faq entries: it supports a large number of command line switches that are described in its own documentation. To access the latter just issue the following command at your shell's prompt:
To put it briefly, however, most times you will want to use perldoc as in one of the following examples:
- perldoc perldata - to read about Perl data types;
- perldoc -f open - to read about the open() function;
- perldoc -q "how do I do X" - to search the FAQ.
The language used by perldoc, POD makes it easy to render the documentation in a variety of target formats, including HTML. Some Perl distributions, most notably ActiveState's ActivePerl, a very popular one under Windows, come with ready made HTML documentation, wich some find easier to read and walk through.
An HTML version of the documentation is also available on the web at http://perldoc.perl.org/ and some other locations. As such, it can be searched through with Google and the above mentioned tutorial contains some specific examples about how to do so.
Some people prefer to use a grep or grep-like utility to search specific stuff in the POD documentation installed on their computers, and one can indeed use such an approach when everything else fails.
Other options include:
- the pure Perl tcgrep implementation from the Perl Power Tools project;
- the specialized podgrep utility from the pmtools distribution;
- zentara's Gtk2 Visual Grep;
- diotalevi's grep, which in turn borrows the pretty formatting of
- petdance's ack.
One additional possibility is to use the perlindex utility, which is "a program to index and search the perl documentation."
The tkpod standalone Tk POD viewer from Tk::Pod (which is a GUI for viewing and browsing Perl's POD documentation) also provides an interface to perlindex if it is installed, and its features additionally include:
- support for single or multiple POD windows;
- tree view of available PODs.
Yet another alternative to perldoc is Pod::Webserver, a minimal web server which serves local Perl documentation: with it one can browse all the docs available on the machine it runs on with a web browser.