Difference between revisions of "POD"

From Dreamwidth Notes
Jump to: navigation, search
m
 
Line 7: Line 7:
 
  cgi-bin/DW/InviteCodes.pm
 
  cgi-bin/DW/InviteCodes.pm
 
  cgi-bin/DW/Shop/Item/Rename.pm
 
  cgi-bin/DW/Shop/Item/Rename.pm
 +
 +
== Examples ==
 +
 +
=== Function with named and optional arguments ===
 +
 +
<syntaxhighlight lang="perl">=head2 C<< $class->check_code( code => $invite [, userid => $recipient] ) >>
 +
 +
Checks whether code $invite is valid before trying to create an account. Takes
 +
an optional $recipient userid, to protect the code from accidentally being used
 +
if the form is double-submitted.
 +
 +
=cut</syntaxhighlight>
  
 
[[Category: Development]]
 
[[Category: Development]]

Latest revision as of 22:09, 3 March 2011

POD stands for Plain Old Documentation format, and we're trying to standardize on all DW code being documented in this fashion.

There is basic documentation about the format.

Examples of code files documented this way already:

cgi-bin/DW/InviteCodes.pm
cgi-bin/DW/Shop/Item/Rename.pm

Examples

Function with named and optional arguments

=head2 C<< $class->check_code( code => $invite [, userid => $recipient] ) >>
 
Checks whether code $invite is valid before trying to create an account. Takes
an optional $recipient userid, to protect the code from accidentally being used
if the form is double-submitted.
 
=cut