The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Pod::Index::Search - Search for keywords in an indexed pod

SYNOPSYS

use Pod::Index::Search;

my $q = Pod::Index::Search->new;

$q->search('getprotobyname');

for my $e ($q->entries) {
    printf "%s\t%s\n", $e->podname, $e->line;
    print $e->pod;
}

DESCRIPTION

METHODS

new
my $q = Pod::Index::Search->new(%args);

Create a new search object. Possible arguments are:

fh

The filehandle of the index to use. If omitted, perlindex::DATA is used.

filename

The filename of the index to use. Note that you can specify either fh or filename, but not both.

filemap

A subroutine reference that takes a podname and returns a filename. A simple example might be:

sub {
    my $podname = shift;
    return "/usr/lib/perl5/5.8.7/pod/$podname";
}

The podname is a relative pathname to an @INC directory, such as Data/Dumper.pm. The slashes are used as delimiters regardless of the platform (see "require" in perlfunc).

search($keyword)

Do the actual search in the index. Returns a list of search results, as Pod::Index::Entry objects.

SEE ALSO

Pod::Index::Entry

AUTHOR

Ivan Tubert-Brohman <itub@cpan.org>

COPYRIGHT

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.