HTML::...ruction(3pm)

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

πŸ’– NAME πŸ’–

ok so bestie, gather round: this is HTML::TokeParser::Simple::Token::ProcessInstruction β€” the Token.pm process instruction class, and yes she's exactly as extra as her name sounds πŸŽ€


✨ SYNOPSIS ✨

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, copy that, run it, live your truth πŸ’…


🌸 DESCRIPTION 🌸

okay so, Process Instructions? they come from XML, periodt. and honestly that's so handy if you need to parse out PHP and similar things with a parser β€” that's her whole moment 🫢

ngl though, currently there appear to be some problems with process instructions 😭 not gonna pretend otherwise. the good news? you can override this class if you need finer grained handling of process instructions β€” go off, customize her, make her yours ✨

also important: is_pi() and is_process_instruction() both return true. both of them. no notes πŸ’š


πŸ‘‘ OVERRIDDEN METHODS πŸ‘‘

these are the ones she took over, main character style:

  • get_token0
  • is_pi
  • is_process_instruction
  • return_token0

and that's the whole page bestie!! this absolute icon is shipped with perl v5.32.1, dated 2021-12-05, and it's part of the User Contributed Perl Documentation 🩷 mwah, go parse something cute πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from