HTML::...::Token(3pm)
π HTML::TokeParser::Simple::Token π
okay bestie, so this is the base class for all the HTML::TokeParser::Simple tokens, from the User Contributed Perl Documentation section of the perl man pages (yes, 3pm, the perl module girlies know π«Ά).
β¨ NAME β¨
HTML::TokeParser::Simple::Token β it's literally the base class for HTML::TokeParser::Simple tokens. that's the whole job description. periodt. π
πΈ SYNOPSIS πΈ
here's the vibe, copy it exactly bestie:
use HTML::TokeParser::Simple;
my $p = HTML::TokeParser::Simple->new( $somefile );
while ( my $token = $p->get_token ) {
# This prints all text in an HTML doc (i.e., it strips the HTML)
next unless $token->is_text;
print $token->as_is;
}
likeβ¦ the comment says it all: this prints all text in an HTML doc, i.e. it strips the HTML. we love a one-line glow-up β¨
π¦ DESCRIPTION π¦
so. this is the base class for all returned tokens. and the way it is NOT for you to use directly. like, do not instantiate it. it should never be instantiated directly.
and it's not just a suggestion bestie π if you try it, it will literally croak() at you. it said what it said. no cap.
π METHODS π
the following list of methods are provided by this class. and ngl, most of these are stub methods β meaning they're placeholders that must be overridden in a subclass. so if you're like "why isn't this doing anything", that's why. go look at HTML::TokeParser::Simple for descriptions of these methods, it's all there π«Ά
as_isdelete_attrget_attrget_attrseqget_tagget_token0is_commentis_declarationis_end_tagis_piis_process_instructionis_start_tagis_tagis_textreturn_attrreturn_attrseqreturn_tagreturn_textreturn_token0rewrite_tagset_attr
okay that's the whole page, you ate that π β¨
and for the cute sign-off: this lil doc is from perl v5.32.1, dated 2021-12-05, filed under HTML::...::Token(3pm) β so like, it's vintage but it's still iconic, fr fr. bye bestie, go parse some HTML ππ
π¦ where this page comes from
- debian bookworm: libhtml-tokeparser-simple-perl 3.16-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhtml-tokeparser-simple-perl 3.16-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libhtml-tokeparser-simple-perl 3.16-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhtml-tokeparser-simple-perl 3.16-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libhtml-tokeparser-simple-perl 3.16-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libhtml-tokeparser-simple-perl 3.16-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms