
\documentstyle[twocolumn]{article}

\title{Perl Program Repair Shop \\ 
        {\small and} \\
        Red Flags \\  Table of Contents}

\begin{document}
\maketitle

{\bf Introduction} (1--13)

What is This Class About?~2~-
A Brief Note About 'Conciseness'~3~-
Counting Lines~4--8~- 
{\it Families of Variables  }~9--13

\medskip 

{\bf 1: Merging Reports} (14--68)

Two-Headed Monster~15~-
Families of Variables~16~-
Digression about Directory Names~17~-
Seven lines become Five~19~-
{\it Make Relationships Explicit }~20--22~-
Comments~21~- 
{\tt GrabFileList}~23--24~-
{\tt CopyFiles}~25--40~- 
Concatenation~28~- 
Parameter Passing~38~- 
{\tt CreateOutputDir}~41--45~-
{\tt CreateInput} becomes {\tt CreateOutputDir}~41~-
Unnecessary Variables~46~-
Diagnostics~48~-
Structure vs. Function~49~-
{\it Minimize Structure}~51~-
{\tt FindLastOut }~52~-
{\tt GetPadString}~55--66~-
The Cardinal Rule of Computer Programming~56~-
{\it Repeated Code is a Mistake}~57--65~-
On Design~68

\medskip 

{\bf 2: Directory Copying} (69--102)

Indentation~-
Boolean Values~-
Precedence Problem~-
Global Variables~-
Function Arguments~-
Dirhandles~-
Repeated Tests~-
Try it Both Ways~-
Error Messages~-
Botched Recursion~-
Function Conception~-
Main Loop~-
{\it Don't take two steps forward and one step back}~-
5 lines become 0~-
Programmers Write Too Much Code~-
{\it Do What You Mean }~-
{\it Say what you Mean}~-
{\it Leaning Toothpick Syndrome }~-
Temporary Variables are Temporary~-
A Note About Portability~-
Directory Copier

\medskip 

{\bf 3: Some Miscellaneous Red Flags} (103--140)

\verb+\"+~-
{\tt print print print print print}~-
{\it Many Very Long Strings}~-
{\it C-style {\tt for} loop }~-
A Lucky Find!~-
File-Scope {\tt my} Variables~-
Superstition~-
Global Lexicals~-
Excessively Decorated Comments~-
Unnecessary Variables~-
Single Scalar Variable in Quotes~-
Array Length Variables~-
Unnecessary Shell Calls~-
Shell Call Security Disaster~-
Capturing the same pattern repeatedly~-
{\tt swswsw} Problem~-
Randal's Rule

\medskip 

{\bf 4: A CGI Program} (141--184)

File-Scope {\tt my} Variables~-
Use Smaller Scope~- 
Repeated Data Structure~-
{\it Try it Both Ways } ~-
Avoid Special Cases~-
Repeated Code~-
Digression: Code and Data Structure Should be in Harmony~-
Unnecessary Subroutine~-
Special Values~-
{\it Don't confuse internal and external representations of data }~-
{\tt print\_table }~-
Tools~-
{\tt evaluate\_board }~-
Let's Not Be Doctrinaire~- 
Uniform Data Representations~-
{\tt get\_computer\_choice }~-
Higher-Order Functions


\medskip 

{\bf 5: System Administration } (185--198)

Indentation~-
Loop Hoisting~-
Pattern Matching~-
{\tt \$\#array }~- 
Boolean Context~-
Special Cases~-
{\it Variable use immediately follows assignment }~-
The Result

\medskip 

{\bf 6: {\tt if } and {\tt else }} (199--215)

Empty {\tt if} or {\tt else} blocks~-
{\tt else} / {\tt if}~- 
The Condition that Ate Michigan~-
{\tt if while if if while if}~-
Unbalanced {\tt if-else} Blocks~-
{\tt unless-else}~-
Minimum


\medskip 

{\bf 7: Generating Reports } (216--271)

Families of Variable Names~-
Automatic Testing~-
{\it Making Two Passes }~-
Preprocessing~-
Maintenance Dilemmas~-
{\it Avoid Special Cases}~- 
{\it Arbitrary Numeric Constants}~-
Flags~- 
Punctuation~-
Extraction~-
{\tt cleanup }~-
Main Loop Finished~-
Missing Element 0~-
Repeated Code~-
{\tt printout}~-
The Maintenance Programmer~-
{\tt elsif}~-
Special Cases~-
Generating Reports

\medskip 

{\bf Conclusion } (272--276)

KLOC~- What to Remember~- Thank You~- Bibliography

\medskip 

{\bf Residue of the Red Flags} (277--298)

Families of Variables~-
Compound Compound Compound Statements~-
Anecdote About Superstition~-
Try it Both Ways~-
Avoid Special Cases~-
Store Related Values Together~-
Avoid Families of Variable Names~-
{\it Don't take two steps forward and one step back}~-
What About Matt Wright?

\end{document}

