Update: submitted.
Speaking of Perl documentation, I generally check it with perldoc from the command line on all the osen I use (i.e. Linux and Windows.) However a while back I stumbled upon a node in which more interesting complementary ways to find relevant info were mentioned, than I would have expected. So I thought of concocting together a brief tutorial summing up what was told there. I'm submitting hereafter a first draft of it. Additions, comments and corrections are welcome.
The draft of the tutorial is provided in the next section and in the appendix below you will find the full source code for it, so to ease corrections and annotations.
Update: I will always keep here the lastest update of the draft, while the first one, along with successive diff -u's will be moved to a separate node.
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:
perldoc perldoc
For some tips about where to look for some particular information, see brian_d_foy's Perl documentation documentation tutorial.
To put it briefly, however, most times you will want to use perldoc as in one of the following examples:
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.
A POD Quick Reference is also available here, at the Monastery, which provides a categorized list of the most frequently used docs right in front of the reader for easy and intuitive access to them.
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.
Under *NIX osen or cygwin, several grep-like utilities are generally availabe out of the box. Under Windows one can use ports from the UNXUTILS or GnuWin32 collections.
Other options include:
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:
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.
Hereafter you find the full source for the proposed tutorial of the previous section. I used <h4> tags for sectioning to keep consistent with this node's sectioning, but they will be promoted to <h3>'s if some consensus will be achieved that it should make its way to the tutorials.
<h4>Perldoc</h4> <p>Perl comes with its own documentation. The most straightforward and + widely preferred way to read it is by means of the <c>perldoc</c> co +mmand line utility. It will give access to specific perl manpages (e. +g.: [doc://perlsyn] for Perl syntax or [doc://perlop] for Perl operat +ors) as well as to the documentation for individual functions and faq + entries: it supports a large number of command line switches that ar +e described in its own documentation. To access the latter just issue + the following command at your shell's prompt:</p> <blockquote>[doc://perldoc|perldoc perldoc]</blockquote> <p>For some tips about where to look for some particular information, +see [brian_d_foy]'s [id://408254] [tutorials|tutorial].</p> <p>To put it briefly, however, most times you will want to use <c>perl +doc</c> as in one of the following examples:</p> <ul> <li>[doc://perldata|perldoc perldata] - to read about Perl data types; +</li> <li>[doc://open|perldoc -f open] - to read about the <c>open()</c> fun +ction;</li> <li><c>perldoc -q "how do I do X"</c> - to search the [doc://perlfaq|F +AQ].</li> </ul> <h4>HTML</h4> <p>The language used by <c>perldoc</c>, [doc://perlpod|POD] makes it e +asy to render the documentation in a variety of target formats, inclu +ding HTML. Some Perl distributions, most notably [http://www.activest +ate.com/|ActiveState]'s [http://www.activestate.com/Products/ActivePe +rl/|ActivePerl], a very popular one under Windows, come with ready ma +de HTML documentation, wich some find easier to read and walk through +.</p> <p>An HTML version of the documentation is also available on the web a +t [http://perldoc.perl.org/] and some other locations. As such, it ca +n be searched through with [http://www.google.com|Google] and the abo +ve mentioned [id://408254|tutorial] contains some specific examples a +bout how to do so.</p> <p>A [id://352893|POD Quick Reference] is also available here, at the +[href://?|Monastery], which provides a <em>categorized</em> list of t +he most frequently used docs right in front of the reader for easy an +d intuitive access to them.</p> <h4>Grep</h4> <p>Some people prefer to use a [wp://grep] or grep-like utility to sea +rch specific stuff in the POD documentation installed on their comput +ers, and one can indeed use such an approach when everything else fai +ls.</p> <p>Under *NIX osen or [http://www.cygwin.com/|cygwin], several grep-li +ke utilities are generally availabe out of the box. Under Windows one + can use ports from the [http://unxutils.sourceforge.net/|UNXUTILS] o +r [http://gnuwin32.sourceforge.net/|GnuWin32] collections.</p> <p>Other options include:</p> <ul> <li>the pure Perl [wp://grep|tcgrep] [http://search.cpan.org/dist/ppt/ +bin/grep|implementation] from the [dist://ppt|Perl Power Tools] proje +ct;</li> <li>the specialized [http://search.cpan.org/dist/pmtools/podgrep|podgr +ep] utility from the [dist://pmtools] distribution;</li> <li>[zentara]'s [id://524324];</li> <li>[id://573020], which in turn borrows the pretty formatting of</li> <li>[petdance]'s [http://search.cpan.org/~petdance/ack/ack|ack].</li> </ul> <h4>Other options</h4> <p>One additional possibility is to use the [http://search.cpan.org/~u +lpfr/perlindex-1.502/perlindex.PL|perlindex] utility, which is <em>"a + program to index and search the perl documentation."</em></p> <p>The [http://search.cpan.org/dist/Tk-Pod/tkpod|tkpod] standalone [mo +d://Tk] POD viewer from [mod://Tk::Pod] (which is a GUI for viewing a +nd browsing Perl's POD documentation) also provides an interface to p +erlindex if it is installed, and its features additionally include:</ +p> <ul> <li>support for single or multiple POD windows;</li> <li>tree view of available PODs.</li> </ul> <p>Yet another alternative to perldoc is [mod://Pod::Webserver], a min +imal web server which serves local Perl documentation: with it one ca +n browse all the docs available on the machine it runs on with a web +browser.</p>
In reply to [RFC] Tutorial: Searching Perl Documentation by blazar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |