Plack::HTTPParser(3)

πŸ’– NAME πŸ’–

Plack::HTTPParser β€” bestie, it parses HTTP headers. that's the whole vibe ✨


🌸 SYNOPSIS 🌸

use Plack::HTTPParser qw(parse_http_request);

my $ret = parse_http_request($header_str, \%env);
# see HTTP::Parser::XS docs

that's it. one import, one call, header string in, \%env out. slay πŸ’…


✨ DESCRIPTION ✨

okay so Plack::HTTPParser is basically the friend who knows everyone and introduces you to the right person 🫢 it's a wrapper class, and all it does is dispatch parse_http_request off to whichever parser it can get its hands on:

  • the XS based HTTP::Parser::XS, written by Kazuho Oku β€” the fast one, the icon, the main character πŸ‘‘
  • or the pure perl fallback based on David Robins' HTTP::Parser β€” slower, but she shows up and she does the job πŸ’œ

ngl that's genuinely all it is. it's giving "facade pattern but make it cute" ✨

πŸŽ€ want to force the slow pure perl version even when the fast XS version is literally right there? set the environment variable PLACK_HTTP_PARSER_PP to 1. that's the switch. that's the whole thing. periodt.

PLACK_HTTP_PARSER_PP = 1 β†’ pure perl, no cap. leave it alone β†’ fast XS if it's available πŸ¦‹


πŸ¦‹ SEE ALSO πŸ¦‹

  • HTTP::Parser::XS β€” the fast XS one πŸ’¨
  • HTTP::Parser β€” the pure perl one πŸŒπŸ’–

and that's the page, bestie!! she was documented by the User Contributed Perl Documentation girlies, this is perl v5.42.3, dated 2026-10-18, and she ATE πŸ’…βœ¨ go parse some headers, you're doing amazing sweetie πŸŽ€πŸ’–πŸŒˆ

πŸ“¦ where this page comes from