GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Jifty::Manual::Style(3) User Contributed Perl Documentation Jifty::Manual::Style(3)

Jifty::Manual::Style - Jifty coding style guide

Default style

When in doubt, default to whatever Damian Conway's Perl Best Practices says.

Private documentation

When documenting a private method, or providing documentation which is not useful to the user of the module (and is presumably useful to the developer), wrap it in =begin/end private. This way it does not show up in perldoc where a user would see it and yet is still available and well formatted (that is, not just a lump comment) when looking at the code.

  =begin private

  =head2 import_extra

  Called by L<Test::More>'s C<import> code when L<Jifty::Test> is first
  C<use>'d, it calls L</setup>, and asks Test::More to export its
  symbols to the namespace that C<use>'d this one.

  =end private

  sub import_extra {
        ...
  }

Test temp files

Files created by tests should be declared as such using Jifty::Test->test_file() so they are cleaned up on a successful test run.

Use Shell::Command

Shell::Command has a number of functions which work like common shell file commands such as "touch", "cp" and "mv". They are battle tested and cross-platform. Use them instead of coding your own.

For example, instead of this:

    open my $file, ">foo";
    close $file;

Do this:

    use Shell::Command;
    touch $file;

Case insensitive matching

To check if a string equals another string case insensitively, do this

    lc $foo eq lc $bar;
    lc $foo eq 'bar';

not this:

    $foo =~ /^\Q$bar\E/i;
    $foo =~ /^bar$/i;
2013-01-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.