views:

120

answers:

3

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

+10  A: 

Yes, it's called 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.

amarillion
Well, it's quite different from JavaDoc or PHPDoc in regards to how you document things, but afaik it is the standard documentation tool
Gordon
I would highly suggest not ever using pod between code (interlaced), as the markup is really bloated and will just serve to obfuscate navigation and code coherency. Write self-documenting code, and put the pod at the bottom of the document below an `__END__` tag.
Evan Carroll
responding to Evan Carroll - this is just personal preference - i generally prefer interlaced pod, it makes it much easier to keep the documentation up-to-date, and any decent editor will make it easy to see what's code and what's pod.
plusplus
+7  A: 

You mean perldoc?

Also see this related Stack Overflow quesion:

Gordon
+7  A: 

Why, yes. Yes, it does! Perldoc.

Paul Nathan