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 "siteerldoc.perl.org" restriction,
for example
<http://www.google.com/search?q=count+occurences+string+site:perldoc.perl.org>
HTH.