Synopsis

Disclaimer: This is not intended to be a full-featured module (yet).

Background: I want all my examples in the POD to be real, executable code.

use Test_Pod_Verbatim_Parser;
# inherits from Pod::Parser
my $parser = Test_Pod_Verbatim_Parser->new;
$parser->parse_from_file($INPUTFILE, $OUTPUTFILE);

Or, from the shell:

cat INPUTFILE | perl -MTest_Pod_Verbatim_Parser -e 'Test_Pod_Verbatim_Parser->new->parse_from_file' >OUTPUTFILE

This modle module takes verbatim blocks of POD and turns them into Test::More test code. Try it out to see the details of the generated code. It also recognizes the following special commands:

=begin test and =end test - between these markers, any verbatim blocks are turned into code (this is the normal behavior anyway) and any plain text blocks are turned into comments. Other POD parsers should normally ignore everything between these markers (unless they happen to recognize test as a format).

=for test [CODE] - whatever immediately follows (if anything) is added to the test code. Like =begin test, this should normally be ignored by other POD parsers.

=for test cut - Normally, consecutive but seperate verbatim blocks are joined into a single test. This command marks the break between two tests.

=for test ignore - Turns on ignore mode; any verbatim and text blocks are ignored until the next =for test [CODE] (where CODE is optional).

Possible To-Do for Later: Actually make this a real module distribution.

Author, Copyright, and License

Copyright (c) 2014 Hauke Daempfling (haukex@zero-g.net).

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

For more information see the Perl Artistic License, which should have been distributed with your copy of Perl. Try the command "perldoc perlartistic" or see http://perldoc.perl.org/perlartistic.html.