PFT::Text::Symbol - Symbol from text scan
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') };
Each instance of PFT::Text::Symbol represents a symbol obtained by parsing the text of an entry PFT::Content::Entry: they are detected as <a> and <img> tags in HTML. Symbols are collected into a a PFT::Text object.
PFT::Text::Symbol
PFT::Content::Entry
<a>
<img>
PFT::Text
An example will make this easy to understand. Let's consider the following tag:
<img src=":key1:a1/b1/c1">
It will generate a symbol $s1 such that:
$s1
$s1->keyword
key1
$s1->args
(a1, b1, c1)
$s1->start
:
$s1->len
1
Since a block of HTML can possibly yield multiple symbols, there's no public construction. Use the scan_html multi-constructor instead.
scan_html
There's no single object constructor. Construction goes through PFT::Text::Symbol->scan_html, which expects an HTML string as parameter and returns a list of blessed symbols.
PFT::Text::Symbol->scan_html
To install PFT, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PFT
CPAN shell
perl -MCPAN -e shell install PFT
For more information on module installation, please visit the detailed CPAN module installation guide.