1

I'm looking for a way of implementing JSDoc style comments in Perl. I've gotten myself stuck in a bit of a Google loop when I search for "JSDoc" and "Perl" because apparently JSDoc is/was written in Perl, and therefore all of my research pushes me in the wrong direction.

I understand that POD is the standard for generating CPAN style documentation, but I haven't had any luck digging up any detailed examples beyond:

  =head1 MYMODULE
  My module is awesome
  =cut

What I'm hoping to have, is something that would be able to handle a comment similar to JSDoc, that supports comments such as this:

/** A sub that does things to AnotherModule
  @description A detailed description of the sub
  @param {MyModule::AnotherModule} anotherModule Another Module
  @returns {MyModule::YetAnotherModule} A modified object
*/
sub ProcessAnotherModule {
...

In a random screenshot on Google search, I've seen a single examples of this:

# @param name Your name
# @return A welcome message
sub hello {
  my $name = shift;
  return "Hello " . $name;
}

Which leads me to believe that somewhere out there, there is a code comment library for handing this.

Any recommendations?

FYI, I'm using Eclipse & Epic, so bonus points if there's a solution that can be implemented in that environment and maybe could output code hinting etc

Ryan Dunphy
  • 792
  • 2
  • 10
  • 33
  • There isn't anything specific. If you look at Perl modules on CPAN and how they are documented you will see some standards, but there are no default Perl toolchain utilities to generate docs. – simbabque Aug 29 '19 at 16:53
  • 1
    See also [How to use Doxygen and Doxygen::Filter::Perl to generate documentation for Perl sub routines?](https://stackoverflow.com/questions/29033768/how-to-use-doxygen-and-doxygenfilterperl-to-generate-documentation-for-perl) – Håkon Hægland Aug 29 '19 at 16:58
  • Seems like Doxygen might be a good fit. I'll just leave this here for future reference: http://www.bigsister.ch/doxygenfilter/documentation.html – Ryan Dunphy Aug 29 '19 at 17:36

0 Answers0