Alex Rivera | Logout

Does Perl have something like Java/PHP Docs?

Asked 2010-01-25T16:52:20.437
12

Does Perl have a Perl Docs generator? Something like Java Docs or PHP Documenter?

Edit
Report

1 Answer

15

Yes, it's called POD (formerly: perldoc)

You simply write documentation in the source, just like with javadoc.

Briefly, "=item" is a bulleted item, e.g. a function or a parameter "=over" goes down a level of identation, "=back" goes up a level. Use "=cut" where you want to switch back to perl code.

Here is an example of what it could look like:

=item $b->add_module ( %options )

Initialize a module. A module is a repository or a branch of a repository.
Valid options are

=over

=item id

Id of this module

=item repo

Url of repository. Currently only subversion repositories are supported.

=back

=cut
sub add_module($%)
{

Simply pass your perl code through the perldoc program to get the formatted documentation.

answered 2010-01-25T16:54:24.763

Your Answer