Pod::I...Search(3pm)
π Pod::Index::Search β bestie's guide to hunting keywords in an indexed pod π
User Contributed Perl Documentation β¨ (Pod::I...Search(3pm), the manual name, if you were wondering β the header truncates it but that's the whole vibe)
πΈ NAME πΈ
Pod::Index::Search β literally searching for keywords in an indexed pod, no cap π
β¨ SYNOPSIS β¨
okay so here's the whole serve, copy-paste ready:
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');
that's it. that's the whole main character moment π
π¦ DESCRIPTION π¦
This module searches an index that was created by Pod::Index::Builder. Every search result you get back is a Pod::Index::Entry object. cute, right? π
You can also search for subtopics of a keyword. like, if you search for operator you might get back stuff like:
operator, conditional
operator, filetest
operator, logical
operator, precedence
operator, relational
and the subtopics you get back? just simple strings. no fancy objects, just strings. humble of them honestly π«Ά
π METHODS π
π new
my $q = Pod::Index::Search->new(%args);
Creates a shiny new search object. The args you can hand it are:
fhβ the filehandle of the index you wanna use. If you don't pass one,perlindex::DATAgets used instead. it's giving "default bestie" πfilenameβ the filename of the index you wanna use. and listen: you can pass eitherfhorfilename, but not both. pick a lane babe, it's giving monogamy πfilemapβ a subroutine reference that takes a podname and hands you back a filename. a simple lil example could be:
sub {
my $podname = shift;
return "/usr/lib/perl5/5.8.7/pod/$podname.pod";
}
just so you know, the podname comes in colon-delimited Perl package syntax π§
The default filemap returns the first file in @INC that seems to have the proper documentation β that's either a .pod or a .pm file. it goes hunting for you, iconic behavior β
nocaseβ if this is true, your search becomes case-insensitive. lowercase, uppercase, doesn't matter, she's not judging π₯
π search($keyword)
Does the actual search in the index. Returns a list of search results, as Pod::Index::Entry objects. the moment of truth, bestie β¨
π subtopics($keyword, %options)
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 the subtopics; otherwise, only the first level of subtopics gets included. surface level vs. going feral, your choice π
π VERSION π
0.14 β she's been around a minute and she's still slaying π
π SEE ALSO π
Pod::Index::Entry, Pod::Index::Builder β go say hi to the family, iykyk π¦
πΈ 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.
fr fr, same terms as Perl itself. respect the license bestie π
and that's the whole page!! πβ¨ this one's from perl v5.30.0, dated 2020-05-17 β so yeah, vintage but still eating π mwah, go search something iconic ππ
π¦ where this page comes from
- debian bookworm: libpod-index-perl 0.14-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libpod-index-perl 0.14-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libpod-index-perl 0.14-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libpod-index-perl 0.14-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libpod-index-perl 0.14-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpod-index-perl 0.14-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms