{
    "mode": "perldoc",
    "parameter": "Pod::Simple",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Pod%3A%3ASimple/json",
    "generated": "2026-06-11T06:51:48Z",
    "synopsis": "TODO",
    "sections": {
        "NAME": {
            "content": "Pod::Simple - framework for parsing Pod\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "TODO\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Pod::Simple is a Perl library for parsing text in the Pod (\"plain old documentation\") markup\nlanguage that is typically used for writing documentation for Perl and for Perl modules. The Pod\nformat is explained in perlpod; the most common formatter is called \"perldoc\".\n\nBe sure to read \"ENCODING\" if your Pod contains non-ASCII characters.\n\nPod formatters can use Pod::Simple to parse Pod documents and render them into plain text, HTML,\nor any number of other formats. Typically, such formatters will be subclasses of Pod::Simple,\nand so they will inherit its methods, like \"parsefile\". But note that Pod::Simple doesn't\nunderstand and properly parse Perl itself, so if you have a file which contains a Perl program\nthat has a multi-line quoted string which has lines that look like pod, Pod::Simple will treat\nthem as pod. This can be avoided if the file makes these into indented here documents instead.\n\nIf you're reading this document just because you have a Pod-processing subclass that you want to\nuse, this document (plus the documentation for the subclass) is probably all you need to read.\n\nIf you're reading this document because you want to write a formatter subclass, continue reading\nit and then read Pod::Simple::Subclassing, and then possibly even read perlpodspec (some of\nwhich is for parser-writers, but much of which is notes to formatter-writers).\n",
            "subsections": []
        },
        "MAIN METHODS": {
            "content": "\"$parser = *SomeClass*->new();\"\nThis returns a new parser object, where *\"SomeClass\"* is a subclass of Pod::Simple.\n\n\"$parser->outputfh( *OUT );\"\nThis sets the filehandle that $parser's output will be written to. You can pass *STDOUT or\n*STDERR, otherwise you should probably do something like this:\n\nmy $outfile = \"output.txt\";\nopen TXTOUT, \">$outfile\" or die \"Can't write to $outfile: $!\";\n$parser->outputfh(*TXTOUT);\n\n...before you call one of the \"$parser->parse*whatever*\" methods.\n\n\"$parser->outputstring( \\$somestring );\"\nThis sets the string that $parser's output will be sent to, instead of any filehandle.\n\n\"$parser->parsefile( *$somefilename* );\"\n\"$parser->parsefile( *INPUTFH );\"\nThis reads the Pod content of the file (or filehandle) that you specify, and processes it\nwith that $parser object, according to however $parser's class works, and according to\nwhatever parser options you have set up for this $parser object.\n\n\"$parser->parsestringdocument( *$allcontent* );\"\nThis works just like \"parsefile\" except that it reads the Pod content not from a file, but\nfrom a string that you have already in memory.\n\n\"$parser->parselines( *...@lines...*, undef );\"\nThis processes the lines in @lines (where each list item must be a defined value, and must\ncontain exactly one line of content -- so no items like \"foo\\nbar\" are allowed). The final\n\"undef\" is used to indicate the end of document being parsed.\n\nThe other \"parser*whatever*\" methods are meant to be called only once per $parser object;\nbut \"parselines\" can be called as many times per $parser object as you want, as long as the\nlast call (and only the last call) ends with an \"undef\" value.\n\n\"$parser->contentseen\"\nThis returns true only if there has been any real content seen for this document. Returns\nfalse in cases where the document contains content, but does not make use of any Pod markup.\n\n\"*SomeClass*->filter( *$filename* );\"\n\"*SomeClass*->filter( INPUTFH* );\"\n\"*SomeClass*->filter( *\\$documentcontent* );\"\nThis is a shortcut method for creating a new parser object, setting the output handle to\nSTDOUT, and then processing the specified file (or filehandle, or in-memory document). This\nis handy for one-liners like this:\n\nperl -MPod::Simple::Text -e \"Pod::Simple::Text->filter('thingy.pod')\"\n",
            "subsections": []
        },
        "SECONDARY METHODS": {
            "content": "Some of these methods might be of interest to general users, as well as of interest to\nformatter-writers.\n\nNote that the general pattern here is that the accessor-methods read the attribute's value with\n\"$value = $parser->*attribute*\" and set the attribute's value with\n\"$parser->*attribute*(*newvalue*)\". For each accessor, I typically only mention one syntax or\nanother, based on which I think you are actually most likely to use.\n\n\"$parser->parsecharacters( *SOMEVALUE* )\"\nThe Pod parser normally expects to read octets and to convert those octets to characters\nbased on the \"=encoding\" declaration in the Pod source. Set this option to a true value to\nindicate that the Pod source is already a Perl character stream. This tells the parser to\nignore any \"=encoding\" command and to skip all the code paths involving decoding octets.\n\n\"$parser->nowhining( *SOMEVALUE* )\"\nIf you set this attribute to a true value, you will suppress the parser's complaints about\nirregularities in the Pod coding. By default, this attribute's value is false, meaning that\nirregularities will be reported.\n\nNote that turning this attribute to true won't suppress one or two kinds of complaints about\nrarely occurring unrecoverable errors.\n\n\"$parser->noerratasection( *SOMEVALUE* )\"\nIf you set this attribute to a true value, you will stop the parser from generating a \"POD\nERRORS\" section at the end of the document. By default, this attribute's value is false,\nmeaning that an errata section will be generated, as necessary.\n\n\"$parser->complainstderr( *SOMEVALUE* )\"\nIf you set this attribute to a true value, it will send reports of parsing errors to STDERR.\nBy default, this attribute's value is false, meaning that no output is sent to STDERR.\n\nSetting \"complainstderr\" also sets \"noerratasection\".\n\n\"$parser->sourcefilename\"\nThis returns the filename that this parser object was set to read from.\n\n\"$parser->dochasstarted\"\nThis returns true if $parser has read from a source, and has seen Pod content in it.\n\n\"$parser->sourcedead\"\nThis returns true if $parser has read from a source, and come to the end of that source.\n\n\"$parser->stripverbatimindent( *SOMEVALUE* )\"\nThe perlpod spec for a Verbatim paragraph is \"It should be reproduced exactly...\", which\nmeans that the whitespace you've used to indent your verbatim blocks will be preserved in\nthe output. This can be annoying for outputs such as HTML, where that whitespace will remain\nin front of every line. It's an unfortunate case where syntax is turned into semantics.\n\nIf the POD you're parsing adheres to a consistent indentation policy, you can have such\nindentation stripped from the beginning of every line of your verbatim blocks. This method\ntells Pod::Simple what to strip. For two-space indents, you'd use:\n\n$parser->stripverbatimindent('  ');\n\nFor tab indents, you'd use a tab character:\n\n$parser->stripverbatimindent(\"\\t\");\n\nIf the POD is inconsistent about the indentation of verbatim blocks, but you have figured\nout a heuristic to determine how much a particular verbatim block is indented, you can pass\na code reference instead. The code reference will be executed with one argument, an array\nreference of all the lines in the verbatim block, and should return the value to be stripped\nfrom each line. For example, if you decide that you're fine to use the first line of the\nverbatim block to set the standard for indentation of the rest of the block, you can look at\nthe first line and return the appropriate value, like so:\n\n$new->stripverbatimindent(sub {\nmy $lines = shift;\n(my $indent = $lines->[0]) =~ s/\\S.*//;\nreturn $indent;\n});\n\nIf you'd rather treat each line individually, you can do that, too, by just transforming\nthem in-place in the code reference and returning \"undef\". Say that you don't want *any*\nlines indented. You can do something like this:\n\n$new->stripverbatimindent(sub {\nmy $lines = shift;\nsub { s/^\\s+// for @{ $lines },\nreturn undef;\n});\n\n\"$parser->expandverbatimtabs( *n* )\"\nDefault: 8\n\nIf after any stripping of indentation in verbatim blocks, there remain tabs, this method\ncall indicates what to do with them. 0 means leave them as tabs, any other number indicates\nthat each tab is to be translated so as to have tab stops every \"n\" columns.\n\nThis is independent of other methods (except that it operates after any verbatim input\nstripping is done).\n\nLike the other methods, the input parameter is not checked for validity. \"undef\" or\ncontaining non-digits has the same effect as 8.\n",
            "subsections": []
        },
        "TERTIARY METHODS": {
            "content": "\"$parser->abandonoutputfh()\"\nCancel output to the file handle. Any POD read by the $parser is not effected.\n\n\"$parser->abandonoutputstring()\"\nCancel output to the output string. Any POD read by the $parser is not effected.\n\n\"$parser->acceptcode( @codes )\"\nAlias for acceptcodes.\n\n\"$parser->acceptcodes( @codes )\"\nAllows $parser to accept a list of \"Formatting Codes\" in perlpod. This can be used to\nimplement user-defined codes.\n\n\"$parser->acceptdirectiveasdata( @directives )\"\nAllows $parser to accept a list of directives for data paragraphs. A directive is the label\nof a \"Command Paragraph\" in perlpod. A data paragraph is one delimited by \"=begin/=for/=end\"\ndirectives. This can be used to implement user-defined directives.\n\n\"$parser->acceptdirectiveasprocessed( @directives )\"\nAllows $parser to accept a list of directives for processed paragraphs. A directive is the\nlabel of a \"Command Paragraph\" in perlpod. A processed paragraph is also known as \"Ordinary\nParagraph\" in perlpod. This can be used to implement user-defined directives.\n\n\"$parser->acceptdirectiveasverbatim( @directives )\"\nAllows $parser to accept a list of directives for \"Verbatim Paragraph\" in perlpod. A\ndirective is the label of a \"Command Paragraph\" in perlpod. This can be used to implement\nuser-defined directives.\n\n\"$parser->accepttarget( @targets )\"\nAlias for accepttargets.\n\n\"$parser->accepttargetastext( @targets )\"\nAlias for accepttargetsastext.\n\n\"$parser->accepttargets( @targets )\"\nAccepts targets for \"=begin/=for/=end\" sections of the POD.\n\n\"$parser->accepttargetsastext( @targets )\"\nAccepts targets for \"=begin/=for/=end\" sections that should be parsed as POD. For details,\nsee \"About Data Paragraphs\" in perlpodspec.\n\n\"$parser->anyerrataseen()\"\nUsed to check if any errata was seen.\n\n*Example:*\n\ndie \"too many errors\\n\" if $parser->anyerrataseen();\n\n\"$parser->errataseen()\"\nReturns a hash reference of all errata seen, both whines and screams. The hash reference's\nkeys are the line number and the value is an array reference of the errors for that line.\n\n*Example:*\n\nif ( $parser->anyerrataseen() ) {\n$logger->log( $parser->errataseen() );\n}\n\n\"$parser->detectedencoding()\"\nReturn the encoding corresponding to \"=encoding\", but only if the encoding was recognized\nand handled.\n\n\"$parser->encoding()\"\nReturn encoding of the document, even if the encoding is not correctly handled.\n\n\"$parser->parsefromfile( $source, $to )\"\nParses from $source file to $to file. Similar to \"parsefromfile\" in Pod::Parser.\n\n\"$parser->scream( @errormessages )\"\nLog an error that can't be ignored.\n\n\"$parser->unacceptcode( @codes )\"\nAlias for unacceptcodes.\n\n\"$parser->unacceptcodes( @codes )\"\nRemoves @codes as valid codes for the parse.\n\n\"$parser->unacceptdirective( @directives )\"\nAlias for unacceptdirectives.\n\n\"$parser->unacceptdirectives( @directives )\"\nRemoves @directives as valid directives for the parse.\n\n\"$parser->unaccepttarget( @targets )\"\nAlias for unaccepttargets.\n\n\"$parser->unaccepttargets( @targets )\"\nRemoves @targets as valid targets for the parse.\n\n\"$parser->versionreport()\"\nReturns a string describing the version.\n\n\"$parser->whine( @errormessages )\"\nLog an error unless \"$parser->nowhining( TRUE );\".\n",
            "subsections": []
        },
        "ENCODING": {
            "content": "The Pod::Simple parser expects to read octets. The parser will decode the octets into Perl's\ninternal character string representation using the value of the \"=encoding\" declaration in the\nPOD source.\n\nIf the POD source does not include an \"=encoding\" declaration, the parser will attempt to guess\nthe encoding (selecting one of UTF-8 or CP 1252) by examining the first non-ASCII bytes and\napplying the heuristic described in perlpodspec. (If the POD source contains only ASCII bytes,\nthe encoding is assumed to be ASCII.)\n\nIf you set the \"parsecharacters\" option to a true value the parser will expect characters\nrather than octets; will ignore any \"=encoding\"; and will make no attempt to decode the input.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Pod::Simple::Subclassing\n\nperlpod\n\nperlpodspec\n\nPod::Escapes\n\nperldoc\n",
            "subsections": []
        },
        "SUPPORT": {
            "content": "Questions or discussion about POD and Pod::Simple should be sent to the pod-people@perl.org mail\nlist. Send an empty email to pod-people-subscribe@perl.org to subscribe.\n\nThis module is managed in an open GitHub repository, <https://github.com/perl-pod/pod-simple/>.\nFeel free to fork and contribute, or to clone <git://github.com/perl-pod/pod-simple.git> and\nsend patches!\n\nPlease use <https://github.com/perl-pod/pod-simple/issues/new> to file a bug report.\n",
            "subsections": []
        },
        "COPYRIGHT AND DISCLAIMERS": {
            "content": "Copyright (c) 2002 Sean M. Burke.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nThis program is distributed in the hope that it will be useful, but without any warranty;\nwithout even the implied warranty of merchantability or fitness for a particular purpose.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Pod::Simple was created by Sean M. Burke <sburke@cpan.org>. But don't bother him, he's retired.\n\nPod::Simple is maintained by:\n\n*   Allison Randal \"allison@perl.org\"\n\n*   Hans Dieter Pearcey \"hdp@cpan.org\"\n\n*   David E. Wheeler \"dwheeler@cpan.org\"\n\n*   Karl Williamson \"khw@cpan.org\"\n\nDocumentation has been contributed by:\n\n*   Gabor Szabo \"szabgab@gmail.com\"\n\n*   Shawn H Corey \"SHCOREY at cpan.org\"\n",
            "subsections": []
        }
    },
    "summary": "Pod::Simple - framework for parsing Pod",
    "flags": [],
    "examples": [],
    "see_also": []
}