http://www.perlmonks.org?node_id=1042723

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have the task of documenting a few hundred shell/perl scripts. The scripts do not have any POD style documentation embedded.

I looked at

http://bahut.alma.ch/2007_08_01_archive.html

that would allow me to use POD style across perl/ksh/bash scripts which can then be used by perldoc or perl2html

There are also other options like Doxygen (I am not at all familiar with this)

I would appreciate any advice.

Replies are listed 'Best First'.
Re: Shell/perl Documentation
by LanX (Saint) on Jul 05, 2013 at 16:53 UTC
      I just have bash, ksh and perl scripts that I need to document. The documentation needs to be relatively simple explaining what the script does.

      As far as performance goes, would it be a good idea to keep the documentation separate? These are existing working scripts. Separating the documentation could be safer.

        You say "Separating the documentation could be safer". I've found that keeping the documentation in the same file as the code make it more likely that it will be updated when the code changes; you don't have to find the doc file. Personally, I'd say that it's safer to have up-to-date docs.
Re: Shell/perl Documentation
by sundialsvc4 (Abbot) on Jul 06, 2013 at 02:46 UTC

    My initial response to this matter is that, all things considered, perhaps you should just examine all of the scripts and write a Word document that contains whatever comments you wish to make about them.   Simply talk to “the equally befuddled persons who are doomed to come after you,” and help them along.   I don’t necessarily interpret this requirement to mean that you should add POD-comments to each file.   (But, if at-all in doubt, ask your manager who gave you this assignment!!)

    My opinion of Doxygen is that (a) it unquestionably delivers to you “what its designers intended,” but (b) that it is not terribly useful.   It is, after all, merely a digital algorithm.   I suspect that you have been tasked to “dive in to all of this (mess) and (please) come up with a useful set of bread-crumbs.”   If Doxygen can provide you with a useful-to-you and-to-your successors part,</em. then by all means use it.   But you, as a human being, will have to go from there to produce a final-product that is useful to the team.