PFT::Text::Symbol(3)

πŸ“¦ version 1.4.1, in fedora 43, fedora 44

✨ 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->keyword is key1 ⭐
  • $s1->args is the list (a1, b1, c1) 🌈
  • $s1->start points to the first : character πŸ‘€
  • $s1->len points 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 πŸ’œ

  • keyword
  • args
  • start
  • len

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