Scroll to navigation

Pod::Abstract::Parser(3pm) User Contributed Perl Documentation Pod::Abstract::Parser(3pm)

NAME

Pod::Abstract::Parser - Internal Parser class of Pod::Abstract.

DESCRIPTION

This is a "Pod::Parser" subclass, used by "Pod::Abstract" to convert Pod text into a Node tree.

Use this class via the Pod::Abstract class which has "load" methods provided.

METHODS

new

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

Requires a Pod::Abstract object to load Pod data into. Should only be called internally by Pod::Abstract.

This is a subclass of Pod::Parser and uses that class to handle all basic Pod parsing, but implements the additional rules from perlpodspec that require more context.

verbatim

In general, a verbatim node is created as any indented text in a POD block. However, there's a special case which is that -

  • If we are in a "begin/end" block, that's by default not parsed, and this should be text, not verbatim.
  • But if we are in a parsed begin/end block ("parse_me") it should still be a verbatim node.

The behaviour here is very much a DWIM - if you're in a non-parsed block this will interpret it correctly even though "Pod::Parser" will tell you it's a verbatim. If you're in a parsed block it will be a ":text".

 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 as "Pod::Parser" class - we are keeping a command stack which lets us know if we should parse the interior sequences of the text block - the "interior sequences" style commands. In some cases perlpodspec requires them to be ignored, and in some cases they should be parsed.

The %no_parse hash defines commands that generally shouldn't be parsed, but the command parser may add a parameter "parse_me" to the command which will cause their text to be parsed as normal POD text.

AUTHOR

Ben Lilburne <bnej80@gmail.com>

COPYRIGHT AND LICENSE

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.

2025-11-16 perl v5.40.1