perldoc related query

B

Bart Lateur

Prasanna said:
In the answers to qurestions , most of the times
perldoc -f <keyword> is referred to... my qn - in the 1st place how do
u know what keyword to look for... is there some index or what for
perldoc or is this index given by the -h option (if it is Iam sorry I
couldnt find it)

There are several indexes. "perldoc perlfunc" shows *all* descriptions
you can look up individually by "perldoc -f foo", but most of all, at
the start of this document there's an overview of keywords grouped per
purpose, under "Perl Functions by Category":

Functions for SCALARs or strings
Regular expressions and pattern matching
Numeric functions
Functions for real @ARRAYs
etc...

But that is just one document (even if it's one of the most important
ones). perl comes with a lot of documentation, and you can get an
overview in "perldoc perl".
... or u get to know this by experience... ('cos when
I wanted to get to the number of times a substring occurred in a
pattern, i was asked to use perldoc -f count.... though this did
work... how would i know to look up count in the first place)

That sounds a bit like search in the FAQs. Well: there's a total of 9
FAQ documents, again, split up by category, perlfaq1 through perlfaq9.
You can see an overview of all titles in "perldoc perlfaq", and "perldoc
perlfaq4" is one of the more important ones: "data manipulation". I
found this entry in there:

How can I count the number of occurrences of a substring within a
string?

You can search through all these FAQ titles with the "-q" option, but I
guess you know that already by now: "perldoc -q count":

How can I count the number of occurrences of a substring within a
string?

How do I count the number of lines in a file?

plus the actual FAQ text in one go.

Oh, you can always use Google to search the docs on
<http://perldoc.perl.org>, with the "site:perldoc.perl.org" restriction,
for example
<http://www.google.com/search?q=count+occurences+string+site:perldoc.perl.org>


HTH.
 
A

Arndt Jonasson

Prasanna said:
Thanks a lot... hopefully the next question which I ask would be
challenging yet meaningful to the grp :)

[and a kind of cat-and-mouse game followed]

I'm glad you got useful help from the group (though I didn't
contribute). I do agree with the two points made by others. One should
provide some context to what one is talking about. The subject line
and nearness in time may be enough sometimes, but since a typical
session reading News involves many threads, quoting a little previous
appropriate material is helpful - not least since the thread may
continue, and losing context makes it increasingly confusing.
Nonstandard abbreviations are alright in very informal chatting, in my
opinion, but not when conducting a respectful discussion with relative
strangers, whatever their age.

I wish you good luck here with your next Perl question.
 
A

Anno Siegel

[...]
correct answer. In the general case, there are three ways of using
^^^^^

Make that four
perldoc:

* Looking up a particular general topic, such as operators or variables...

* Looking up a given function, such as push or system. If you know the...

* Looking up answers to FAQs. If you can make a pretty good guess as...

* Looking up the documentation of an installed module or pragma...

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,175
Messages
2,570,942
Members
47,476
Latest member
blackwatermelon

Latest Threads

Top