HTML::...omment(3pm)

πŸ“¦
version 3.16 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’¬ NAME πŸ’¬

okay bestie, gather round β€” this is HTML::TokeParser::Simple::Token::Comment, aka the Token.pm comment class. she's the little glow-up wrapper that handles comment tokens and she's literally so iconic for it πŸŽ€


✨ SYNOPSIS ✨

here's the vibe, copy-paste it and go πŸ‘‘

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… look at that loop. she's looping. she's filtering. she's printing. main character energy fr fr πŸ¦‹


🌸 DESCRIPTION 🌸

so basically? this is the class for comment tokens. that's her whole job. comments. she ate and left no crumbs πŸ’…

and if you wanna go deep-deep on what comments actually are under the hood, go read HTML::Parser β€” it has the detailed info about comments, no cap πŸ“šβœ¨


πŸ‘‘ OVERRIDDEN METHODS πŸ‘‘

πŸ“ is_comment

is_comment() will return true if the token is the DTD at the top of the HTML. yes bestie, that's what the doc says and we're reporting it faithfully, iykyk πŸ™ˆ

not me double-checking that this method lives under OVERRIDDEN METHODS β€” she does, she's a little overachiever πŸŽ€

πŸ’– that's the whole page πŸ’–

lowkey short, highkey perfect. this page came from perl v5.32.1, dated 2021-12-05, and it's filed under HTML::...omment(3pm) in the User Contributed Perl Documentation. mwah, take care of her 🫢🌈⭐

πŸ“¦ where this page comes from