update
[urisagit/Perl-Docs.git] / metadoc
CommitLineData
cf83821d 1
2Perl is blessed with an extensive set of accurate and informative
3documentation. As there are so many resources it is useful to have
4an overview of what is available, where it is and how best to read it.
5This document is called perlmetadoc reflecting that it is about the
6other documents.
7
8<these topics aren't in any particular order yet>
9
10Installing Perl Documentation
11
12The core Perl documentation is usually installed along with Perl, but
13some OS's may have it as a separate package (usually called perl-doc).
14To see if you have the documentation installed or not type 'perldoc
15perldoc' on the command line, otherwise use your OS's package manager to
16install the documentation.
17
18When you install a module from CPAN (see below), its documentation
19will also be installed. You can then use the 'perldoc' command (see below)
20to read the module's documentation.
21
22
23
24
25How do you find the Perl Documentation?
26
27When you have a properly installed Perl, you can find documents by
28running the 'perldoc' command (see below). This command knows where the
29documents are installed on your system and will print them out. It is
30smart enough to search for the Perl core documents including those of
31core modules as well as the documents for modules you install. Another
32method of printing the documents is the 'man' command (if you have a
33UNIX/Linux flavor OS). Perl documents are also installed where man can
34find and print them.
35
36What are the kinds of Documents?
37
38Perl comes with a large number of documents but they are generally
39grouped into several categories. You can see the categories and which
40documents are in them by running the command 'perldoc perl'. Overview
41documents have indexes of the documents and an introduction to
42Perl. Tutorials are meant to to teach and explain a particular topic
43such as regular expressions or Perl objects. The FAQ documents are also
44considered tutorials. The reference documents are the description of the
45Perl language and are packed full of information. The next category
46covers the internals of the perl program and how to embed C code. These
47are generally for those who need special knowledge and are rarely read
48by beginners. The miscellaneous category has various documents that
49don't fit other categories and include the delta documents which cover
50the changes made to Perl from version to version. Then there are human
51language specific documents and platform specific documents.
52
53How best to read Perl Documentation
54
55Reading language documentation can be difficult, especially when you are
56first learning a language and when there is a large amount of
57documentation. But there are ways to make it easier and more
58effective. First off you can use the site http://perldoc.perl.org (see
59below) to read the Perl documents if that make it easier for you. Then
60you can do what is called skim reading to start. When you read one of
61the documents, try to read the entire text of it. If you don't
62understand some section or it isn't important to you, it is ok to skip
63or skim it. The goal is to let you see the scope of that document and
64for you to discover new things each time you read it all. As you get
65more proficient you can fully read sections you skimmed earlier and
66learn them. And later on you can just go to the part you want to read
67and find out what you need to know. Even experts will skim read some
68documents as new features are added to Perl and they can discover them
69when reading the whole document. Skim reading is especially helpful when
70reading the FAQ (see below), perlop (about the Perl operators) and
71perlfunc (all about Perl's functions) as they are divided up into many
72sections. Another tip is a classic when reading documentation - follow
73the see also references and links to other documents. Some documents are
74closely related to others and will have information which will help you
75even though they weren't the initial document you read.
76
77Searching the Perl documents
78
79Knowing where something is covered in a document can be tricky when
80there is so much documentation. The overview documents can help (see
81below) but there are several other ways to improve your searching. The
82perldoc command (see below) can search the FAQ for you. It can also
83print out the documentation for any Perl builtin function. The
84perldoc.perl.org site has a very good search engine which can help you
85find the document and section you are seeking. On platforms which have
86the grep command, you can search the document text directly by going to
87the directory where it is installed.
88
89The perldoc command
90
91The primary way to read Perl documents is with the perldoc command. You
92just need to run the command 'perldoc <docname>' and it will be
93displayed for you. In most systems it will send the document through a
94paging program so you can read it page by page, search for strings and
95even go backwards as desired. This command has several useful options
96among which the most commonly used are -q which does a keyword query
97against the Perl FAQ documents and -f which prints out a single function
98from the perlfunc document. Of course, you can read more about this
99command by running 'perldoc perldoc'!
100
101Overview Perl Documents
102
103There are several Perl documents that are useful for navigating around
104the rest of the documents. They are perl, perltoc and perlblurb (to be
105written). The perl document (yes, its name is just 'perl') is a listing
106of all the Perl documents with a one line description of each one. The
107documents are grouped by their type such as tutorial, reference, etc. It
108is useful to get a quick look at all the document titles and their short
109descriptions. The perltoc (Table of Contents) document is automatically
110generated and contains all the section headings found in all the
111documents. This is very long and it is bested used for searching for
112topics of interest. You can do that on http://perldoc.perl.org (see
113below), or with the grep command, or when you display it with perldoc
114(see how to use perldoc). The perlblurb document (new, to be written) is
115an expanded version of the 'perl' document but instead of a short
116description for each document, it has a short paragraph describing
117it. It is good for browsing for topics of interest and seeing which
118documents are related to others.
119
120The perldoc.perl.org site
121
122Another popular way to read and search the Perl documents is
123http://perldoc.perl.org. This web site has HTML versions of all the Perl
124documents in a framed design with the types and document names along
125side the document you selected. It has many advantages over the local
126version of the documentation including full searching, recently viewed
127pages, syntax highlighting of code examples and more. One very useful
128feature is that you can select which version of Perl's documents you see
129(going back to 5.8.8). The perldoc.perl.org site has only a couple of
130downsides. One is that you need web access and a browser to get to this
131site and if you are off the net, you always have the local
132documentation. The other is that it doesn't cover the modules you
133installed from CPAN (see below). This means you have to use the locally
134installed documentation for those modules or read the documentation from
135CPAN (http://search.cpan.org).
136
137The Perl FAQ
138
139Perl being as popular as it is and with so many developers learning and
140using it, you would expect many questions will be asked. So, of course
141Perl has an extensive set of Frequently Asked Questions (FAQ) with
142answers and code examples. The FAQ is divided up into 9 chapters (and
143one on Unicode). You can see the topics covered in each chapter in the
144'perl' document or at http://perldoc.perl.org/index-faq.html. We
145recommend that if you are learning Perl that you skim read the entire
146FAQ (as mentioned above). The first two chapters are general questions
147about Perl and installing it. The rest cover various technical areas. It
148is important to skim read it all so you know the scope and type of
149questions and answers in the FAQ. Later on you can reread chapters and
150more of it will be of use to you. At some point you can just query the
151FAQ and find out answers to specific questions you have. You can search
152the FAQ with the perldoc -q <keys> command or on http://perldoc.perl.org.
153
154Module documentation
155
156Perl has two collections of modules, those that come with Perl when you
157install it and those on the CPAN (a large public archive of Perl
158modules). When a module is installed on your system, its documentation
159(also written in POD as are the documents) will be installed too. The
160perldoc command can find and print out module documents as it does the
161main Perl documents - just type perldoc <Module::Name>. Also on systems
162that support it, man style versions of the documents will be installed
163and you can get the documents by running the man command with the module
164name.