Pod::I...Builder(3pm)

✨ Pod::Index::Builder ✨

okay bestie, welcome to the Pod::Index::Builder page β€” yes it's from the User Contributed Perl Documentation and yes it's giving 3pm manual energy, but we're gonna make it cute πŸ’…


πŸ¦‹ NAME πŸ¦‹

Pod::Index::Builder β€” literally builds a pod index, that's the whole job πŸŽ€


🌸 SYNOPSIS 🌸

use Pod::Index::Builder;

my $p = Pod::Index::Builder->new(
    pi_base => $base_path,
);
for my $file (@ARGV) {
    $p->parse_from_file($file);
}

$p->print_index;

no cap, that's it. that's the whole flow. parse files, print index, slay ✨


πŸ’– DESCRIPTION πŸ’–

so. this is a subclass of Pod::Parser, which means it reads POD and outputs... nothing. truly the silent main character πŸ™ˆ. but here's the tea: while it's reading, it saves the position of every single X<> entry it sees πŸ‘‘

and then you can grab that index either as a hashref, or print it out in a format that Pod::Index::Search can actually understand. iykyk 🫢


πŸ‘‘ METHODS πŸ‘‘

πŸ“ new

the constructor, inherited from Pod::Parser. the only optional argument it actually cares about is pi_base πŸ’œ

if you give it one, it gets used as a base when converting pathnames into package names. for example, if pi_path = lib, then the filename lib/Pod/Index.pm turns into Pod::Index β€” instead of the extremely undesirable lib::Pod::Index πŸ’€

not the lib:: prefix bestie. we don't do that here. periodt.

🧚 pod_index

retrieves the index as a hashref ✨

  • the hash keys are the keywords contained in the X<> tags, normalized to lowercase
  • the values are array references of Pod::Index::Entry objects 🌈
$parser->print_index($fh);
$parser->print_index($filename);
$parser->print_index();

prints the index to the given output filename or filehandle β€” or STDOUT by default if you're feeling lazy, which, valid 🫢

the format is tab-delimited, with these columns:

  1. keyword
  2. podname
  3. line number
  4. context (title of section containing this entry)

and the index is sorted by keyword in a case-insensitive way. obsessed with the consistency honestly ⭐


⭐ VERSION ⭐

0.14


🌈 SEE ALSO 🌈

  • Pod::Index
  • Pod::Index::Entry
  • Pod::Index::Search
  • Pod::Parser
  • perlpod

go read them, they're all iconic in their own way πŸ’–


πŸŽ€ AUTHOR πŸŽ€

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.


and that's the whole page bestie!! πŸ¦‹βœ¨ this was perl v5.30.0, dated 2020-05-17, and it's the Pod::I...Builder(3pm) page πŸ’… mwah, go build an index, you got this 🫢🌸

πŸ“¦ where this page comes from