I have been meaning to post a question / request about perldocs on
here but keep forgeting. It would be immensely helpful to me, and no
doubt others on here, to have a good description of how to get
information out of perldocs.
I'll offer what help I can below.
I have fumbled with the perldoc -f
That looks in only one of the hundred-plus POD files (perlfunc.pod).
Searching less than 1% of the available information means you will
often miss what you are looking for.
I was kinda suprised when I did a perldoc -f for and it came up
with nothing on the for loop).
That is because "control structures" are not "functions".
Perl's control structures are documented in perlsyn.pod.
grep For all.heads
shows these 2 lines
perlsyn.pod:=head2 For Loops
perlsyn.pod:=head2 Foreach Loops
among its 50-some lines of output.
Bill Hl > Bile oMost of the time I usually end up
looking through a printed copy of all the docs (500+ double sided, 2
up pages) that I had printed about 8 years ago.
Computers are much better at searching than using paper...
I have never seen a simple "How do I
find ?????? in perldoc?".
I never actually use perldoc for searching the standard docs. I use grep(1).
I use perldoc for reading a module's docs fairly regularly though. I most
often use it only for getting the module's docs into a file though (so
that I can then grep it). eg:
perldoc -u DBI >DBI.pod
If this exists, it would be a great FAQ to
have in the rotation, and possibly weighted so it shows up often. If
it doesn't exist, maybe it should be written and placed in there.
Looks like it has been a couple of years since I last posted
my "Perl problem resolution checklist", so here it is again:
----------------------------------
Perl problem resolution checklist:
----------------------------------
1) check the Perl FAQs
(word search with "perldoc -q". Or better, find where the
*.pod's are on your system, and word search (grep) the
entire contents of the files)
2) expand the above to _all_ of the standard *.pod files.
3) check a Usenet archive such as:
http://groups.google.com/advanced_group_search
4) check books and websites (this step is optional)
5) write a Usenet article, but don't post it yet!
5a) make a small and complete (including data) program that
people can execute that shows your problem.
5b) state how the program's output is not what you want. Describe
what you want.
5c) repeat steps 1-4 using search terms taken from your description
of the problem or your Subject header (try some synonyms for
the terms also)
6) Give up on a quick answer. Post to Usenet for a slow answer.
7) wait hours/days/forever for followups with answers rather than
than the 5 or 10 minutes it would have taken if steps 1-3
had worked.
8) Wonder at the quality of the answers given, rather than know
it is a peer-reviewed, validated answer if steps 1-2 had worked.
9) Repeat steps 1-3 many times for many problems. You will seldom
get past step 3, and even less often get past step 5a.
10) Now that you know so much, go *answer* some questions on Usenet
-----
To help with 1 and 2 above, I make "headlines" files to grep in,
because sometimes there is Too Much Information when grepping
the entire bodies:
cd /an/INC/dir/pod/
grep '^=' perlfaq[1-9].pod >faq.heads
grep '^=' *.pod >all.heads