I prefer to have most of my documentation at the end of the module, after the __END__. The one fly in this ointment is maintaining the list of functions and the calling information, and brief descriptions, which I prefer to keep just above the functions. For example, if one has to put the module description at the top of the code file, one will tend to write less documentation, if only to not have to scroll through it to get to the start of the "real code". Also, while it's nice to have a short description of what a function does and its arguments, I find there are times when I want longer notes, but not at the head of the function (again for the same reason "you have to scroll through it to get to the code"). Beginning users of a module would be happy if there were documentation at the end (per function), while the maintainers of the module would be happier if there were minimal docs intermixed with the code (well, at least _this_ maintainer would).
The point I'm making is it's nice if the POD and code can be somewhat decoupled in terms of order for a variety of reasons. Another way to put it is documentation and code are different things, that while often go together (for code maintenance), they also tend to get in the way once one knows what one is doing.
Are there any tools that help maintain PODs using this style (auto-copy functions to POD __END__ FUNCTION section)? My thought is that since POD is so simple, the approach is to have some Auto-POD maintainer tools, that do some simple things. Perhaps, for example, they will automatically generate function "calling signatures" from the existing code (i.e. like javadoc, which will give the function signature, but only augment it if you add, for example, argument descriptions).
Note, I've gone through some of the CPAN example modules and I find the intermixing approach to produce (in my opinion) fairly ugly code.
In reply to POD using __END__ with function comments by zerohero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |