PERLINDEX(1p)

πŸ“¦
version 1.606 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

okay bestie, say hi to perlindex β€” she indexes and queries your perl manual pages, and she's iconic for it πŸ’… this one lives in section 1p, aka the User Contributed Perl Documentation corner of the manual-verse πŸ¦‹


✨ SYNOPSIS ✨

perlindex -index

perlindex tell me where the flowers are

like. that's it. that's the whole vibe. you either build the index or you ask her a cute little question 🌸


πŸ’– DESCRIPTION πŸ’–

perlindex -index generates an AnyDBM_File index that you can search with free text queries β€” like perlindex a verbose query. no cap, that's the whole loop πŸ”

Every single word of your query gets searched in the index, and a score gets generated for each document containing it. Then all the word scores get added up and the documents with the highest score get printed. Before any indexing or searching happens, all words get stemmed with Porters algorithm (see Text::English) β€” so yeah, she does linguistics on your behalf, she's multifaceted πŸ’…

The score is computed as:

$score{$document} += $tf{$word,$document}/$maxtf{$document}
                     * log ($N/$n{$word});

and here's what each lil piece means, bestie:

  • $N β€” is the number of documents in the index
  • $n{$word} β€” is the number of documents containing the word
  • $tf{$word,$document} β€” is the number of occurrences of word in the document
  • $maxtf{$document} β€” is the maximum frequency of any word in document

math class but make it fashion πŸŽ€


πŸ‘‘ OPTIONS πŸ‘‘

every single option may be abbreviated β€” she's flexible like that, she gets it πŸ’œ

  • -maxhits maxhits β€” Maximum numer of hits to display. Default is 15.
  • -menu, -nomenu β€” Use the matches as menu for calling man. Default is -menu.q (fr that's what the page says, typo and all β€” not me, I'm just the messenger πŸ’€)
  • -cbreak, -nocbreak β€” Switch to cbreak in menu mode or don't. -cbreak is the default.
  • -verbose β€” Generates additional information which query words have been not found in the database and which words of the query are stopwords πŸ‘€
  • -conf β€” Use another config than the default config (/etc/perlindex/config).

🌈 EXAMPLE 🌈

perlindex foo bar

1  3.735 lib/pod/perlbot.pod
2  2.640 lib/pod/perlsec.pod
3  2.153 lib/pod/perldata.pod
4  1.920 lib/Symbol.pm
5  1.802 lib/pod/perlsub.pod
6  1.586 lib/Getopt/Long.pm
7  1.190 lib/File/Path.pm
8  1.042 lib/pod/perlop.pod
9  0.857 lib/pod/perlre.pod
a  0.830 lib/Shell.pm
b  0.691 lib/strict.pm
c  0.691 lib/Carp.pm
d  0.680 lib/pod/perlpod.pod
e  0.680 lib/File/Find.pm
f  0.626 lib/pod/perlsyn.pod
Enter Number or 'q'>

so the tea is πŸ“ Hitting the keys 1 to f will display the corresponding manual page. Hitting q quits. All other keys display this manual page. that's the whole control scheme, she's not complicated, she's just efficient ✨


πŸŽ€ FILES πŸŽ€

The index will be generated in your man directory. Strictly speaking in $Config{man1direxp}/.. 🫢

The following files will be generated:

index_fn           # docid -> (max frequency, filename)
index_idf          # term  -> number of documents containing term
index_if           # term  -> (docid, frequency)*
index_seen         # fn    -> indexed?

a whole lil family of index files, they're giving organized πŸ¦‹


πŸ’œ AUTHOR πŸ’œ

Ulrich Pfeifer <pfeifer@ls6.informatik.uni-dortmund.de>


and that's the whole page, bestie β€” shoutout to perl v5.40.1, dated 2026-01-01, living under the PERLINDEX(1p) banner, brought to you by User Contributed Perl Documentation. go index something, you ate πŸ’…βœ¨

πŸ“¦ where this page comes from