develooper Front page | perl.perl5.porters | Postings from December 2000

=code language ... =back in POD

Thread Next
December 12, 2000 10:20
=code language ... =back in POD
Message ID:

Helo all,

Simon asked in

>(Hey, maybe someone would like to try writing a program that automatically
>extracts example code from the documentation and makes sure it compiles?)

- From this emerged.
(Thanx Brad and Simon!)

While developing this, it turned out that except probably SYNOPSIS any pod
section can contain anything in a verbatim paragraph, not only code.

It is hard to see wether something is really a faulty example, or no
code at all, so a lot of false positives are turned up. (From 1107 files in
my /usr 668 turned up syntax errors in verbatim paragraphs. Most of them
are no code at all.). My idea was to use something like:


=code perl

Here is some Perl code: (This paragraph is not verbatim, so it is
ignored by the checker)

        print   "Hello Perl\n";


And here in C:

=code C

        printf("Hello World\n");


Shell code is different, too:

=code shell

        echo Helo World



What do you think of this idea? It might take a lot of work to adapt the
existing documentation, but once this is done, the Pod::Checker::Code
could be used to verify that all the examples are still correct (at least
compilable - runable? Never, not enough setup in most examples..but that
needs not be, anyway). There are a lot of typos in examples, even in

Without something like =code, the checker turns up too many false
positives, and this becomes pretty fast a nightmare.

Alternatively one could think of:

=language Perl

but =code is shorter, so I prefer it.

Here is what my search turned up:

I think the prior thread discussed a change to Perl (...), but I
propose a change to Pod. (I hope I got that right)

Thanx for your time,




- --
 "Why do you go so slowly? Do you think this is some kind of game?"     Thief - The Dark Project   Rewriting the HTML as we know it.       Fight for your right to link. 
 PGP key available on or via email.

The email address contained in the From/Reply of this email is NOT
to be displayed on webpages, entered into any mailing lists, given 
to other people, used to send me electronic greeting cards without
my written, signed permission. No SPAM nor UCE, either! Thank you!
And PLEASE refrain from forwarding me chain letters, massmailings,
or pyramid schemes.

Version: 2.6.3i
Charset: latin1


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About