perl.pod-people
  Home FAQ Contact Sign in
perl.pod-people only
 
Advanced search
November 2006
motuwethfrsasuw
  12345 44
6789101112 45
13141516171819 46
20212223242526 47
27282930    48
2006
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2006      
total
perl.pod-people Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  Shorter way to document Perl code?         


Author: Kelly Jones
Date: Nov 24, 2006 16:54

I'm using POD to document some Perl code-- a library w/ a bunch of functions.

For clarity, I want to put each function's documentation next to the
function itself. I don't want to combine all the documentation at the
start or end of the library. I realize perldoc doesn't care where the
documentation is, but it seems easier to maintain with the
documentation next to the function.

My "problem": to document a one-line function, I have to do this:

=item make_ref(URL,TEXT)

Return string to make text a hyperlink to URL

=cut
sub make_ref {return "$_[1]"}

It takes 5 lines of POD to document one line of code? Ouch!

That's a lot of screen real estate when viewing the file in emacs.

Is there a shortcut? Can I make this work somehow?:

=item make_ref(URL,TEXT)
Return string to make text a hyperlink to URL
=cut

I know POD requires blank lines, but is there a workaround to avoid this?

Ideally, I'd like something like
Show full article (1.35Kb)
3 Comments