|
Pod::Index::Search - Search for keywords in an indexed pod |
Pod::Index::Search - Search for keywords in an indexed pod
use Pod::Index::Search;
my $q = Pod::Index::Search->new;
my @results = $q->search('getprotobyname');
for my $r (@results) {
printf "%s\t%s\n", $r->podname, $r->line;
print $r->pod;
}
my @subtopics = $q->subtopics('operator');
This module searches an index created by the Pod::Index::Builder manpage. Search results are returned as the Pod::Index::Entry manpage objects.
It is also possible to search for subtopics for a keyword. For example, a search for ``operator'' might return things like
operator, conditional
operator, filetest
operator, logical
operator, precedence
operator, relational
The subtopics returned are simple strings.
my $q = Pod::Index::Search->new(%args);
Create a new search object. Possible arguments are:
fhperlindex::DATA is used.
filenamefh or
filename, but not both.
filemap
sub {
my $podname = shift;
return "/usr/lib/perl5/5.8.7/pod/$podname.pod";
}
The podname is in colon-delimited Perl package syntax.
nocasesearch($keyword)
my @topics = $q->subtopics('operator');
my @topics = $q->subtopics('operator', deep => 1);
Lists the subtopics for a given keyword. If deep is given, it includes
all subtopics; otherwise, only the first level of subtopics is included.
0.12
the Pod::Index::Entry manpage, the Pod::Index::Builder manpage
Ivan Tubert-Brohman <itub@cpan.org>
Copyright (c) 2005 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
Pod::Index::Search - Search for keywords in an indexed pod |