PFT::Map::Index(3)
π PFT::Map::Index π
okay bestie, gather round, because this is PFT::Map::Index from the User Contributed Perl Documentation collection and it is literally the little symbol-resolver that could. no cap, this module resolves symbols in PFT Entries and honestly? iconic behaviour. π
β¨ NAME β¨
PFT::Map::Index β Resolve symbols in PFT Entries π
πΈ SYNOPSIS πΈ
okay so there are like three whole moods you can be in here, and we're gonna walk through every single one.
Explicit construction β you're doing it yourself, main character energy:
use PFT::Map::Index;
die unless $map->isa('PFT::Map');
my $index = PFT::Map::Index->new($map);
Using map property β letting the map hand you one, lowkey easier:
my $index = $map->index;
Resolution β the actual moment we've all been waiting for, bestie:
die unless $node->isa('PFT::Map::Node');
die unless $sym->isa('PFT::Text::Symbol');
$index->resolve($node, $sym);
π¦ DESCRIPTION π¦
So a PFT::Map::Index object handles the unique identifiers of content items that are mapped in a PFT::Map object. That's its whole job and it does it gorgeously, fr fr.
You can use it to resolve symbols of a PFT::Map::Node, or to query the map β for example, the set of entries between date X and date Y. so versatile. π«Ά
π Properties π
mapβ Reference to the associated map. that's it, that's the property. simple, elegant, slay. β¨
π Methods π
content_id
Given a PFT::Content::Base object (or any subclass of it, we love an inheritance moment π), this returns a string that uniquely identifies it across the site. E.g.:
my $id = $resolver->content_id($content);
my $id = $resolver->content_id($virtual_page, $hdr);
my $id = $resolver->content_id(undef, $hdr);
okay so about that header β the header is optional for the first two forms. unless you supply it, it'll be retrieved by the content. but in the third form the content is not supplied, so the header is mandatory. no header, no id, bestie. that's the rule. π
resolve
The function resolves a symbol retrieved from the text of a PFT::Map::Node. The returned value will be one of the following:
- A list of nodes (i.e. a
PFT::Map::Nodeinstances); π - A list of strings (e.g.
http://manpages.org); π - An empty list (meaning: failed resolution). π
okay so that last one? an empty list means the resolution failed. not me getting an empty list and thinking everything was fine. π
and that's the whole page, babe. this was perl v5.42.0, dated 2025-07-25 β go forth and resolve those symbols. periodt. π β¨π
π¦ where this page comes from
- fedora 43: perl-PFT 1.4.1-18.fc43 Β· GPL-3.0-or-later
- fedora 44: perl-PFT 1.4.1-18.fc43 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms