Perl Style: The Care and Feeding of Modules

  • Document your modules with Pod. Test your pod with pod2man and with pod2html.
  • Use the Carp module’s carp, croak, and confess routines, not warn and die.
  • Well written modules seldom require ::. Users should get at module contents using an import or a class method call.
  • Traditional modules are fine. Don’t jump to full objects just because it’s considered cool. Do it only when the occasion obviously calls for it.
  • Access to objects should only be through object methods.
  • Object methods should themselves access class data through pointers on the object.

Forward to Patches
Back to Switch Using for and do{} Even More Creatively
Up to index

Copyright © 1998, Tom Christiansen All rights reserved.

Tags

Feedback

Something wrong with this article? Help us out by opening an issue or pull request on GitHub

TPRF Gold Sponsor
TPRF Silver Sponsor
TPRF Bronze Sponsor