PFT::Text::Symbol(3)
β¨ NAME β¨
PFT::Text::Symbol β bestie, it's a Symbol from a text scan π
This is the PFT::Text::Symbol(3) page from the User Contributed Perl Documentation, and she's here to tell you all about how symbols get sniffed out of HTML text. π
πΈ SYNOPSIS πΈ
my $array = PFT::Text::Symbol->scan_html($your_html_text);
foreach (PFT::Text::Symbol->scan_html($your_html_text)) {
die unless $_->isa('PFT::Text::Symbol')
};
π¦ DESCRIPTION π¦
Okay so every single instance of PFT::Text::Symbol is literally one symbol that got picked up by parsing the text of a PFT::Content::Entry. How do they get detected? They show up as <a> and <img> tags inside HTML, periodt. π
And where do all these lil symbols end up? They get collected into a PFT::Text object. cute, right? π«Ά
An example is gonna make this so easy to get, trust. Say we have this tag:
<img src=":key1:a1/b1/c1">
That right there generates a symbol $s1 such that:
$s1->keywordiskey1β$s1->argsis the list(a1, b1, c1)π$s1->startpoints to the first:character π$s1->lenpoints to the last 1 character π₯
And because one single block of HTML can lowkey yield multiple symbols, there's no public construction. nope. instead you use the scan_html multi-constructor. iykyk π
π Construction π
Construction usually goes through PFT::Text::Symbol->scan_html, which expects an HTML string as its parameter and hands you back a list of blessed symbols. slay. π
For other needs (like, say, testing π):
PFT::Text::Symbol->new($keyword, [$arg1, β¦, $argn], $start, $length)
π Properties π
keywordargsstartlen
And that's the whole vibe, bestie! π This lil masterpiece is chillin' on perl v5.42.0, dated 2025-07-25 β PFT::Text::Symbol(3) forever π¦β¨π
π¦ 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