Pod::A...:Parser(3pm)

πŸ“¦
version 0.26 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Pod::A...:Parser(3pm) πŸ’–

okay so bestie, first things first β€” this page lives in the User Contributed Perl Documentation section of the manual, and the full name of the thing is Pod::Abstract::Parser. Manifesting that you read the whole thing, mkay? ✨

🌸 NAME 🌸

Pod::Abstract::Parser β€” the internal parser class of Pod::Abstract. yeah. it's the backstage crew, not the main character (that's Pod::Abstract itself, iykyk).

πŸ¦‹ DESCRIPTION πŸ¦‹

So this is a Pod::Parser subclass, right? And Pod::Abstract uses it to turn your Pod text into a lovely little Node tree. 🌳✨

Do NOT summon this class directly, bestie. You get to it through the Pod::Abstract class, which ships with load methods all ready for you. that's the whole point. use those. 🫢

πŸ‘‘ METHODS πŸ‘‘

πŸ’… new

Pod::Abstract::Parser->new( $pod_abstract );

It needs a Pod::Abstract object to load the Pod data into β€” literally required, no object, no parser. And fr fr, this is an internal call: only Pod::Abstract itself should be invoking it. πŸ™ˆ

Fun fact: this thing is a subclass of Pod::Parser and lets that class handle all the basic Pod parsing, but then it layers on the extra rules from perlpodspec that need more context than the base parser has. she does a little extra. πŸ’β€β™€οΈ

πŸŽ€ verbatim

Okay so general rule: any indented text inside a POD block becomes a verbatim node. cool cool. BUT. there's a special case, and it's giving plot twist:

  • If we're inside a "begin/end" block, that block is by default not parsed, so that text should be text, not verbatim.
  • But if we're inside a parsed begin/end block ("parse_me"), then it should still be a verbatim node.

The way this behaves is very much a DWIM moment β€” if you're in a non-parsed block it'll interpret it correctly even though "Pod::Parser" will tell you it's a verbatim. And if you're in a parsed block, it'll be a ":text". no cap. πŸ”₯

 This would be verbatim.

 =begin example

 But if this command was at the start of the line, this would be non-parsed
 and would instead be a text node.

 =end

🌈 textblock

Textblock handling works like the "Pod::Parser" class does β€” we're keeping a command stack around so we know whether we should parse the interior sequences of the text block. yep, the "interior sequences" style commands. πŸ‘€ In some cases perlpodspec says they must be ignored, and in some cases they should be parsed. so we track it. iconic behaviour honestly.

The %no_parse hash defines the commands that generally shouldn't be parsed β€” but the command parser may add a parameter called "parse_me" to the command, which then makes their text get parsed as normal POD text. slay. πŸ’–

✨ AUTHOR ✨

Ben Lilburne <bnej80@gmail.com> β€” king behavior, we love him. πŸ‘‘

Copyright (C) 2009-2025 Ben Lilburne

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


aaand that's the whole page bestie, you ate that. πŸ’…πŸŒΈ no notes. this was generated by perl v5.40.1 on 2025-11-16 β€” so like, go forth and parse responsibly. mwah. πŸ«ΆπŸ’–πŸ¦‹

πŸ“¦ where this page comes from