IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 12, 2004, 5:33:53 PM (22 years ago)
Author:
jhoblitt
Message:

example corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/misc/perlCodeConventions.tex

    r2361 r2362  
    1 %%% $Id: perlCodeConventions.tex,v 1.13 2004-11-13 03:12:31 jhoblitt Exp $
     1%%% $Id: perlCodeConventions.tex,v 1.14 2004-11-13 03:33:53 jhoblitt Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    295295alone file is as follows:
    296296
     297e.g. for file Foo.pod:
     298
    297299\begin{verbatim}
    298300=pod
     
    469471\begin{verbatim}
    470472    if ($foo) {
    471 #        print( "foo" );
     473#        print("foo");
    472474    }
    473475\end{verbatim}
     
    482484if (0) {
    483485    if ($foo) {
    484         print( "foo" );
     486        print("foo");
    485487    }
    486488}
     
    738740\subsection{if, if-else, if elsif else Statements}
    739741
    740 \code{if} statements must always use braces {} around statements and parenthesis
     742\code{if} statements must always use braces \{\} around statements and parenthesis
    741743() around conditionals.
    742744
     
    796798
    797799A Perlish \code{for} or \code{foreach} statement (also known as an iterator)
    798 should have the folliwng form:
     800should have the following form:
    799801
    800802\begin{verbatim}
     
    847849MYLABEL: while (condition) {
    848850    if (condition) {
    849         next;
     851        next MYLABEL;
    850852    }
    851853}
     
    980982Constants &
    981983
    982 Perl's \code{constant} pragma should be used to declare constants.  Note:
    983 'constants' created this way can not be interpolated inside of double quoted
    984 strings.
     984Constant names should be in all capital letters and highly descriptive.  The
     985\code{constant} pragma should be used to declare constants.  Note: 'constants'
     986created this way can not be interpolated inside of double quoted strings.
    985987
    986988&
    987 \code{use constant MAXLEN => 40;}\hfil\break
    988 \code{use constant LENGTH => qw(2, 4, 8);}\hfil\break
     989\code{use constant PI => 3.14159265;}\hfil\break
     990\code{use constant LENGTHS => qw(2, 4, 8);}\hfil\break
    989991\code{use constant CLASSES => (raw => 1, processed => 2);}\hfil\break
    990992
     
    10011003\code{package Time::HiRes;}\hfil\break
    10021004\code{package XML::SimpleObject;}\hfil\break
     1005
     1006\\
     1007
     1008Labels &
     1009
     1010Label names should be in all capital letters and short.  Generally they should
     1011attempt to describe the 'thing' being operated on by the loop they are labeling.
     1012
     1013&
     1014
     1015\code{LINE:}\hfil\break
     1016\code{CONNECTION:}\hfil\break
     1017\code{IMAGE:}\hfil\break
    10031018
    10041019\\
Note: See TracChangeset for help on using the changeset viewer.