Harald Richard Ashburner wrote:
Question:
How do I get an index or a table of contents? How do I find out how to search the perldocs for "control structures"


I've tried:
perldoc perldoc
perldoc -f if
perldoc -q control
perldoc -q index
perldoc -q contents
perldoc -q perldoc

eg
perldoc perltoot gets me what looks like a nice OO tutorial, but how would I know it is
there unless I'd seen it in a post on a website someplace.

The best way to find stuff is to browse everything. Don't try to learn everything at once. Just browse and remember where everything is. As a programmer, I've found this is the biggest key. There is too much to know. The best you can do is *become* an index. You don't have to learn everything (but do try); it's enough to be able to jump straight to the info that you need.


Which is what you were asking anyway, so...

The "beginning" of the perl documentation is:

perldoc perl

Here you'll find a list of all the pods and a brief one line synopsis of what is contained in each. For more detail try:

perldoc perltoc

which contains a full table of contents for all the pods included with perl.

--------

As far as searching, you have several options.

One is to use grep to search the pod. First find out where the main pod files are installed on your system:

perldoc -l perl
=> /usr/share/perl/5.8/pod/perl.pod

The run grep on all the pod files (perl*.pod). For example, here is a query I recently ran:

grep 'while.\+defined.\+<.*>' /usr/share/perl/5.8/pod/perl*.pod

looking for occurences of while (defined($var = <FH>)) and similar.

Another good solution, is to install the great 'perlindex' tool from cpan <http://search.cpan.org/dist/perlindex/>. This is a very nice tool for searching all pod for perl and all installed manuals.

Finally, there is Perldoc.com where you can browse or search documentation for the last couple of versions of perl.

Randy.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to