KW.pm Perl Style Guides #13

Slash Style Guide: Coding Principles 2

  • Lexical Variables

    • globals are never used where a lexical or local() will work

    • don't use 'our' because it requires 5.6

  • Pass by Reference

    • arrays and hashes are passed by reference only.

  • All object classes must provide a DESTROY method.

    • If it doesn't do anything, provide it anyway.

        sub DESTROY {};
  • Do not use __END__ or __DATA__ because they break mod_perl.

  • Do not use die() or exit() ever in slash web-based programs.

    • (see above about throwing exceptions in Ensembl; slash doesn't explicitly talk about exception handling)

  • Do not use shift, use @_ because it is faster.

<< Previous | Index | Next >> Copyright © 2002 Daniel Allen