%					-*- LaTeX -*-
%\documentclass[landscape]{slides}
% $Id: perl-talk-slides.tex,v 1.2 1998/06/17 05:16:10 arensb Exp arensb $
\documentclass{slides}
\usepackage{graphics}
\usepackage{color}

\settoheight{\headheight}{%
% XXX
%Hello, world!
  \includegraphics{logo-small.eps}
}
\newlength{\logowidth}
\settowidth{\logowidth}{\includegraphics{logo-small.eps}}
\setlength{\topmargin}{0pt}
%\setlength{\headheight}{2cm}
\makeatletter
\renewcommand{\ps@slide}{%
    \renewcommand{\@evenfoot}{\@empty}
%    \renewcommand{\@oddfoot}{\@empty}
\renewcommand{\@oddfoot}{\hfil\theslide}
    \renewcommand{\@evenhead}{\hfil UMIACS\hfil}%
%    \renewcommand{\@oddhead}{\hfil UMIACS\hfil}%
    \renewcommand{\@oddhead}{%
% XXX
      \includegraphics{logo-small.eps}%
%      \hfil
%      {\hskip-2em\large\textbf{\underline{\slidetitle}}}
\hskip 1em%
      {\large\textbf{\underline{\slidetitle}}}
      \hfil
    }
}
\newcommand{\slidetitle}{}

% This just redefines \slidetitle, so it'll show up in the page header
\newcommand{\heading}[1]{%
%  \begin{center}
%    \large\textbf{\underline{#1}}
%  \end{center}
%  \vspace{1ex minus 1ex}}
\renewcommand{\slidetitle}{#1}%
}

\newcommand{\inlineheading}[1]{%
%  \begin{center}
\hskip\logowidth
\hskip 1em
    {\large\textbf{\underline{#1}}}
%  \end{center}
  \vspace{1ex minus 1ex}\par}

\newcommand{\code}[1]{\texttt{#1}}
% Make curly braces come out right.
\renewcommand{\{}{\symbol{"7B}}
\renewcommand{\}}{\symbol{"7D}}
\newcommand{\bs}{\texttt{\symbol{"5C}}}	% Backslash
\renewcommand{\tilde}{\symbol{"7E}}	% Tilde
\newcommand{\amp}{\symbol{"26}}		% Ampersand
\newcommand{\vs}{\texttt{\char`\ }}	% Visible space
\newcommand{\perl}{Perl}

\newcommand{\bull}{$\bullet$\hskip8pt}
%\newlength{\bullwidth}
%\settowidth{\bullwidth}{$\bullet$\hskip8pt}
%\newcommand{\bull}{\hbox to\bullwidth{\hss$\bullet$\hskip8pt}}

\newcommand{\alttwo}[2]{%
\item[\vbox{\hbox to0pt{\hss#1}%
            \hbox to0pt{\hss#2}}]%
}
\newcommand{\altthree}[3]{%
\item[\vbox{\hbox to0pt{\hss#1}%
            \hbox to0pt{\hss#2}%
            \hbox to0pt{\hss#3}}]%
}

\newcommand{\bigitem}[1]{%
\item[\vbox{\hbox to\leftmargin{\hskip-\leftmargini#1\hss}
	    \hbox to0pt{\hss}}]%
}

%\def\@listi{\parsep .5\parskip
%            \topsep \parsep
%            \itemsep\parskip
%            \partopsep \z@}
% This is a hack to make fairly narrow 'itemize' lists
\def\@listi{\parskip 2pt
            \parsep .5\parskip
            \topsep \parsep
            \itemsep\parskip
            \partopsep \z@}

\begin{document}
\small
\pagestyle{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\begin{center}
{\Huge \perl\ Programming}
\vskip1cm
{\large Andrew Arensburger}
\vskip1cm
{\code{http://www.cfar.umd.edu/\tilde arensb/text/talks/perl/}}
\end{center}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Preramble}

\begin{quote}
\begin{verbatim}
perl5 -e 'print "Hello, world!\n"'

#!/usr/imports/bin/perl5
print "Hello, world!\n";
\end{verbatim}
\end{quote}

\begin{itemize}
\item Perl is semi-compiled.
\item Perl is case-sensitive.
\item Perl is the Swiss Army Chainsaw.
	\bigskip
%\item[]
\item Variable types include:
	\begin{itemize}
	\item Scalars
	\item Arrays
	\item Hashes
	\item References
	\item[\ldots] and a few others.
	\end{itemize}
\item Variables need not be declared in advance.
\item The type of a variable is determined from context.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Scalars}
%
\begin{itemize}
\item A scalar is any single value: a number or a string.
\item Numbers are internally represented as strings.
\end{itemize}

\begin{quote}
\begin{verbatim}
$var = "Just another Perl hacker.";
print $var;

($a, $b, $c) = (1, 2, 3);
($a, $b, $c) = ($c, $b, $a);
\end{verbatim}%$
\end{quote}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Arrays}
%
\begin{itemize}
\item An array is an ordered list of scalars.
\item It's an array, it's a linked list, it's a deque.
\item No need to declare an array's size because:
\item Arrays grow and shrink dynamically.
\item Indices begin at 0.
	\begin{verbatim}
	@array = @otherarray;
	@mixed = ( "arensb", 2072, 10 );
	@empty = ();

	$foo            = $array[9];      # Resize array
	$array[3]       = $bar;           # Assign to element
	@other          = @array[2,0,1];  # Get some elements
	@baz            = @array[4..8];   # Get a range
	($a, $b, @rest) = @array;         # Array assignment
	$foo            = ("a", "b", "c")[1];

	$#foo           = 35;             # Resize array
	\end{verbatim}%$
\item The deque functions:\\
	\begin{tabular}{lrcl}
	\code{push @array, \$value}	&			& array	& $\Leftarrow$ value \\
	\code{\$value = pop @array}	&			& array	& $\Rightarrow$ value \\
	\code{\$value = shift @array}	& value $\Leftarrow$	& array	& \\
	\code{unshift @array, \$value}	& value $\Rightarrow$	& array	& \\
	\end{tabular}
\item Getting the size of an array:
%	\begin{quote}
	\begin{verbatim}
	$size = $#array + 1;
	$size = @array;
	$size = scalar(@array);
	\end{verbatim}
%	\end{quote}
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Hashes}
%
\begin{itemize}
\item A hash table is an associative array.
\item It's a look-up table.
\item It's an unordered set.
%\begin{quote}
\begin{verbatim}
%user2group = (
        arensb  => 10,
        root    => 0,
        bin     => 3,
);
$user2group{"arnie"} = 199;
%empty = ()

$group  = $user2group{"arensb"};
@groups = @user2group{"root", "bin"};
\end{verbatim}%$
%\end{quote}
%
\item \code{keys \%hash} returns a list of the keys.
\item \code{values \%hash} returns a list of the values.
\item \code{each \%hash} returns each entry in turn.
\item \code{defined} and \code{each} tell you if a hash entry exists.
%\begin{quote}
\begin{verbatim}
defined($user2group{"arnie"})
exists($user2group{"arnie"})

delete($user2group{"arnie"});
\end{verbatim}%$
%\end{quote}
\end{itemize}
\vskip1cm

\inlineheading{Barewords}
%
\begin{itemize}
\item Avoid them.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Numbers}
%
\begin{quote}
\begin{verbatim}
  123
 0456           # Octal
0x8a0           # Hex
0.998
 .998
9.98e-1
1_234_567_890
\end{verbatim}
\end{quote}
\vskip1cm

\inlineheading{Contexts}
%
\begin{itemize}
\item Scalar (expects a scalar value).
\item List (expects an array value).
\item[\ldots] and a few others.
\end{itemize}

%\begin{quote}
\begin{verbatim}
@array = ("a", "b", "c");
 $foo  = @array;    # Set $foo to size of @array
($bar) = @array;    # Set $bar to first element
                    # of @array

$time = localtime;  # Returns "Sat Jun 13 14:19:35 1998"
@time = localtime;  # Returns (35 19 14 13 5 98 6 163 1)
\end{verbatim}%$
%\end{quote}

\begin{itemize}
\item Use \code{scalar} to force scalar context.
\item \code{wantarray} will tell you if you're in a list context.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Special Variables, Part 1}
%
\begin{tabular}{rll}
\code{\$ARG}	& \code{\$\_}
	& The Universal Default. \\
		& \code{\$?}
	& Child error status. \\
\code{\$ERRNO}	& \code{\$!}
	& Error returned by last system call. \\
\code{\$PID}	& \code{\$\$}
	& Process ID. \\
\code{\$UID}	& \code{\$<}
	& Real UID. \\
\code{\$EUID}	& \code{\$>}
	& Effective UID. \\
\code{\$GID}	& \code{\$(}
	& Real GID. \\
\code{\$EGID}	& \code{\$)}
	& Effective GID. \\
		& \code{@ARGV}
	& Command-line arguments. \\
		& \code{\$0}
	& Name of the script. \\
		& \code{\%ENV}
	& Environment. \\
		& \code{\%SIG}
	& Signal handlers. \\
		& \code{@INC}
	& Include directories. \\
		& \code{\%INC}
	& Included files. \\
		& \code{\$]}
	& \perl\ version. \\
		& \code{\$\^{}O}
	& OS name. \\
		& \code{\$\^{}X}
	& \perl\ executable. \\
		& \code{\$\^{}T}
	& Start time. \\
		& \code{\$\^{}W}
	& Is \code{-w} on?
\end{tabular}

\begin{itemize}
\item \code{use English;} if you don't like line noise.
\item Those are carets, not control characters (phew!)
\item See mnemonics in \textrm{perlvar(1)}.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Quoting}
%
\begingroup
\settowidth{\leftmargin}{\code{qw\{}\ldots\code{\}}}
\addtolength{\leftmargin}{1em}
\begin{itemize}
\alttwo	{\code{'abc'}}
	{\code{q\{abc\}}}
	Literal quotes. \\
	\code{'It\bs's\ \ \ \bs\bs quot"ing'} $\Rightarrow$ \code{It's\ \ \ \bs quot"ing}\\
\alttwo	{\code{"ab\$c"}}
	{\code{qq\{ab\$c\}}}
	Interpolates variables and backticks.\\
	\code{"Say \$greeting"} $\Rightarrow$ \code{Say hello}\\
\alttwo	{\code{`abc`}}
	{\code{qx\{abc\}}}
	Runs a command, returns what it printed.\\
	\code{\`{}date\`{}} $\Rightarrow$ \code{Tue Jun 16 18:37:11 EDT 1998}\\
\item[\code{qw\{a b c\}}]
	Literal array.\\
	\code{qw/foo bar baz/} \quad$=$\quad \code{('foo', 'bar', 'baz')}\\
\end{itemize}
\endgroup

\begin{itemize}
\item Interpolated arrays use \code{\$"} (\code{\$LIST\_SEPARATOR}).
\item ``Here'' documents:
\begin{tiny}
%\begin{quote}
\begin{verbatim}
# Wrong                         # Right
print <<end                     print <<EOT;
Just another Perl hacker.       Just another Perl hacker.
end;                            EOT
\end{verbatim}
%\end{quote}
\end{tiny}
\item Quoting the end-of-text word gives you those kinds of quotes.
\item You can have multiple ``here'' documents on a line.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Math Operators}
%
\begingroup
\settowidth{\leftmargin}{\code{<}, \code{<=}, \code{==}, \code{>=}, \code{>}, \code{!=}}
\addtolength{\leftmargin}{1em}
\begin{itemize}
\addtolength{\labelsep}{1em}
\item[\code{+}, \code{-}, \code{*}, \code{/}]
	The usual arithmetic operators.
\item[\code{\%}]
	Modulus.
\item[\code{**}]
	Exponentiation.
\item[\code{\amp}, \code{|}, \code{\^}, \code{\tilde}]
	Bit-wise and, or and exclusive-or, and not.
\item[\code{<<}, \code{>>}]
	Left and right bit-shift.
\item[\code{+=}, \code{-=}, etc.]
	\textit{operator}-and-assign. Works just as in C, with
	all of the operators above.
\item[\code{++}, \code{--}]
	Pre- and post-increment and -decrement.\\
	\code{++} is magical.
\item[\code{<}, \code{<=}, \code{==}, \code{>=}, \code{>}, \code{!=}]
	Numeric comparison. Non-numeric strings are equal to 0.
\item[\code{<=>}]
	Generalized numeric comparison operator. \code{\$a~<=>~\$b}
	returns -1, 0 or 1, depending on whether \code{\$a} is less
	than, equal to, or greater than \code{\$b}.
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{String Operators}
%
\begingroup
\settowidth{\leftmargin}{\code{lt}, \code{le}, \code{eq}, \code{ge}, \code{gt}, \code{ne}}
\addtolength{\leftmargin}{1em}
\begin{itemize}
\addtolength{\labelsep}{1em}
\item[\code{.} (dot)]
	Concatenate two strings.
\item[\code{.=}]
	Concatenate and assign.
\item[\code{x}]
	String multiplier: \code{"ab" x 3} $\Rightarrow$ \code{"ababab"}
\item[\code{x=}]
	String multiply and assign.
\item[\code{lt}, \code{le}, \code{eq}, \code{ge}, \code{gt}, \code{ne}]
	String comparison operators.
\item[\code{cmp}]
	Generalized string comparison operator. \code{\$a cmp \$b}
	returns -1, 0 or 1, depending on whether \code{\$a} is less
	than, equal to, or greater than \code{\$b}.
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{File Operators}
%
\begin{itemize}
\item \code{-}\textit{X FILEHANDLE} or \code{-}\textit{X filename}.
\item Use \code{\_} to reuse \code{stat()} results.
\end{itemize}

\begingroup
\settowidth{\leftmargin}{\code{-r}, \code{-w}, \code{-x}, \code{-o}}
%\addtolength{\leftmargin}{1em}
\begin{itemize}
\addtolength{\labelsep}{1em}
\item[\code{-r}, \code{-w}, \code{-x}, \code{-o}]
	File is readable, writable, executable, owned by euid.
\item[\code{-R}, \code{-W}, \code{-X}, \code{-O}]
	File is readable, writable, executable, owned by euid.
\item[\code{-e}]
	File exists.
\item[\code{-z}]
	File has zero size.
\item[\code{-s}]
	Size of file (hence functions as a ``file has non-zero size''
	test).
\item[\code{-M}, \code{-A}, \code{-C}]
	File's mtime, atime, ctime.
\item[\code{-f}]
	File is a plain file.
\item[\code{-d}]
	File is a directory.
\item[\code{-l}]
	File is a symbolic link.
\item[\code{-p}]
	File is a named pipe.
\item[\code{-S}]
	File is a socket.
\item[\code{-b}]
	File is a block special file.
\item[\code{-c}]
	File is a character special file.
\item[\code{-t}]
	File is a filehandle opened to a terminal (\code{isatty()}).
\item[\code{-u}]
	File has the setuid bit set.
\item[\code{-g}]
	File has the setgid bit set.
\item[\code{-k}]
	File has the sticky bit set.
%\item[\code{-T}]
%	File is a text file.
%\item[\code{-B}]
%	File is a binary file.
\end{itemize}
\endgroup
%
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Other Operators}
%
\begingroup
\settowidth{\leftmargin}{\code{and}, \code{or}, \code{xor}, \code{not}}
\addtolength{\leftmargin}{1em}
\begin{itemize}
\addtolength{\labelsep}{1em}
\item[\code{=\tilde}, \code{!\tilde}]
	Match on something other than \code{\$\_}. \code{!\tilde}
	negates the result.
\item[\code{\amp\amp}, \code{||}]
	Logical and, or.
\item[\code{!}]
	Not.
\item[\code{\amp}, \code{|}, \code{\^}, \code{\tilde}]
	Bitwise and, or, xor; one's complement.
\item[\code{?:}]
	Inline if-then-else.
\item[\code{..} (dot dot)]
	Range operator, or flip-flop.
\item[\code{and}, \code{or}, \code{xor}, \code{not}]
	Low-precedence \code{\amp\amp}, \code{||}, \code{\^}, \code{!}
\end{itemize}
\endgroup

\vskip1cm
\begin{itemize}
\item Don't memorize the precedence hierarchy. Just use parens.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{\code{if} and \code{unless}}
\begin{quote}
\begin{tabbing}
\code{if} \= \code{(}\textit{condition}\code{) \{}\\
	\> \textit{commands}\\
\code{\}}\\
$[$\code{elsif (}\textit{condition}\code{) \{}\\
	\> \textit{commands}\\
\code{\}}$\ldots]$\\
$[$\code{else \{}\\
	\> \textit{commands}\\
\code{\}} $]$\\
\end{tabbing}
\end{quote}

\begin{itemize}
\item Parentheses are mandatory (except in postfix version).
\end{itemize}
\vskip.5cm

\begin{quote}
\textit{command} \code{if} \textit{condition}\code{;}\\
\textit{command} \code{unless} \textit{condition}\code{;}\\
\end{quote}

\hrule

\begin{tiny}
\begin{verbatim}
if ($foo eq "abc") {
        print "Foo is abc\n";
}

print "foo is abc\n" if $foo eq "abc";
\end{verbatim}
\end{tiny}

\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{What is Truth?}
%
\begin{itemize}
\item Empty arrays and hashes are false.
\item Undefined variables are false.
\item 0 is false.
\item \code{""} (empty string) and \code{undef} are false.
\item Anything that isn't false is true.
	\bigskip
\item To undefine a variable:
\begin{quote}
\begin{verbatim}
undef $var;
$var = undef;
\end{verbatim}
\end{quote}
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{\code{while} and \code{until}}
%
\begin{normalsize}
\begin{quote}
\begin{tabbing}
\code{while} \= \code{(}\textit{condition}\code{) \{}\\
	\> \textit{commands}\\
\code{\}}\\
$[$\code{continue \{}\\
	\> \textit{commands}\\
\code{\}} $]$\\
\end{tabbing}
\end{quote}
%
\begin{quote}
\textit{command} \code{while} \textit{condition}\code{;}\\
\textit{command} \code{until} \textit{condition}\code{;}
\end{quote}
\end{normalsize}
\bigskip

\begin{itemize}
\item Note: \code{do} \textit{BLOCK} \code{until} \textit{condition}\\
	will run at least once.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{\code{for} and the other \code{for}}
%
\begin{normalsize}
\begin{quote}
\begin{tabbing}
\code{for} \= \code{(}\textit{init}\code{;}
		\textit{condition}\code{;}
		\textit{continue}\code{) \{}\\
	\> \textit{commands}\\
\code{\}}
\end{tabbing}
\end{quote}

\begin{quote}
\begin{tabbing}
\code{for} \= $[$\textit{var}$]$ \code{(}\textit{list}\code{) \{}\\
	\> \textit{commands}\\
\code{\}}
\end{tabbing}
\end{quote}
\end{normalsize}
\begin{itemize}
\item \code{foreach} is a synonym for \code{for}.\\
\end{itemize}
\vskip1cm

%\hrule\bigskip
\inlineheading{\code{do} \textit{BLOCK}}

\begin{itemize}
\item% \code{do} \textit{BLOCK}\\
	executes BLOCK and returns the value of the last statement
\begin{tiny}
\begin{quote}
\begin{verbatim}
open INFILE, "/my/file" or do {
        print STDERR "I don't know what to do!\n";
        exit 1;
    }
\end{verbatim}
\end{quote}
\end{tiny}
\item A bare block is a loop that runs once.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Loop Control}
%
\begin{itemize}
\item \code{last}\hspace{2em}Break out of a loop.
\item \code{next}\hspace{2em}Go on to the next iteration.
\item \code{redo}\hspace{2em}Go back to the top.
	\bigskip
\item Use block labels to break out of nested loops:
\begin{quote}
\begin{verbatim}
OUTER: for ($i = 0; $i < 100; $i++)
{
    INNER: for ($j = 0; $j < 10; $j++)
    {
        if (&an_error_has_occurred)
        {
            last OUTER;
        }
    }
}
\end{verbatim}
\end{quote}
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{File I/O}
%
The canonical file read loop:
\begin{quote}
\begin{verbatim}
open INFILE, "/my/file";
while ($line = <INFILE>)
{
        # Do something
}
close INFILE;
\end{verbatim}%$
\end{quote}
\begin{quote}
\begin{tabular}{ll}
\bull Open for reading: &\code{open IN, "</my/file";}\\
\bull Open for writing: &\code{open IN, ">/my/file";}\\
\bull Open for appending: &\code{open IN, ">>/my/file";}\\
\bull Open pipe for reading: &\code{open IN, "command|";}\\
\bull Open pipe for writing: &\code{open IN, "|command";}
\end{tabular}
\end{quote}

\begin{itemize}
\item \code{STDIN}, \code{STDOUT} and \code{STDERR} come pre-opened.
\item \code{print} \textit{[FILEHANDLE]} \textit{[expr]}\code{;}
\item Note: no comma after \textit{FILEHANDLE}.
\item Remove trailing \code{\bs n} with \code{chop} or \code{chomp}.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Brackety Magic}
%
\begin{itemize}
\item \code{<}\textit{FILEHANDLE}\code{>} reads the next line (in a scalar
	context).
\item \code{<}\textit{FILEHANDLE}\code{>} reads whole file (in a list
	context).
\item \code{while (<FILEHANDLE>)} puts the line in \code{\$\_}.
\item \code{<>} reads all of the files in \code{@ARGV}, or
	\code{-} (dash) if there are none.
\item \code{-} is magic: it's either \code{STDIN} or \code{STDOUT}.
\item Yes, you can set \code{@ARGV} to mess with \code{<>}'s mind.
\item \code{<}\textit{glob}\code{>} expands filenames.
\begin{tiny}
\begin{quote}
\begin{verbatim}
while (</tmp/*>) {
        print "Just another temp file: $_\n";
}
\end{verbatim}%$
\end{quote}
\end{tiny}
%
\item \code{eof(}\textit{FILEHANDLE}\code{)},  \code{eof} and \code{eof()}.
\item \code{perl5 -ne} \textit{script} yields
\begin{tiny}
\begin{quote}
\code{while (<>) \{}\\
\hbox to4em{}\textit{script}\\
\code{\}}
\end{quote}
\end{tiny}
%
\item \code{perl5 -pe} \textit{script} yields
\begin{tiny}
\begin{quote}
\code{while (<>) \{}\\
\hbox to4em{}\textit{script}\\
\code{\} continue \{ print \}}
\end{quote}
\end{tiny}
%
\item \code{perl -i}\textit{extension} edits in-place.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Formats}
%
\begin{tiny}
\begin{verbatim}
format NEWHOST =
Name:   @>>>>>>>>>  IP: @<<<<<<<<<<<<<< Ether: @|||||||||||||||||
        $hostname,      $ip,            $ether
Domain:    @>>>>>>          CPU Tag: @<<<<<<<<<<<<<<<<<<<<
        $domain,        $cpu_tag,
                        Monitor Tag: @<<<<<<<<<<<<<<<<<<<<
                        $mon_tag
Problems with the installation:
    ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        $problems
~   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        $problems
~   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
        $problems
~   ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<...
        $problems
# Should there be more than four lines for problems?

Comments:
@*
$comments
.

$~ = NEWHOST;                   # Set the format

$hostname = "glitnir";          # Initialize the format
$domain   = "CfAR";
$ip       = "128.8.132.40";
...
write;                          # Write a record
\end{verbatim}%$
\end{tiny}
\begin{itemize}
\item Use \code{@\#\#\#\#\#} or \code{@\#\#\#\#.\#\#} for numbers.
\item Each filehandle has a default format, with the same name as the
	filehandle.
\item Each format has an associated top-of-page format,
	\textit{FORMAT}\code{\_TOP} by default.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{I/O Special Variables}
%
\begin{tabular}{rll}
& \code{\$\_} &
	Default reading/writing space.\\
& \code{\$ARGV} &
	Name of the current file when reading with \code{<>}.\\
\code{\$RS} & \code{\$/} &
	Input record separator (magical).\\
& \code{\$|} &
	If nonzero, flush after every write.\\
\code{\$OFS} & \code{\$,} &
	Output field separator.\\
& \code{\$"} &
	Separator for arrays interpolated into strings.\\
{\code{\$NR}} & \code{\$.} &
	Input line number.\\
& \code{\$=} &
	Number of lines per page.\\
& \code{\$-} &
	Number of lines left on the page.\\
& \code{\$\%} &
	Output page number.\\
& \code{\$\tilde} &
	Name of current format.\\
& \code{\$\^} &
	Name of top-of-page format.\\
& \code{\$:} &
	Line-break characters for formats.\\
& \code{\$\^{}L} &
	How to output a formfeed.\\
& \code{\$\^{}A} &
	\code{write} accumulator.\\
& \code{\$\^{}I} &
	In-place editing extension.\\
\end{tabular}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Regular Expressions}
%
\begin{itemize}
\item A regular expression is a pattern of characters.
\item An ordinary character matches itself.
\item Variables are interpolated into patterns.
\item \code{m/}\textit{pattern}\code{/} returns true if \code{\$\_} matches \textit{pattern}.
\end{itemize}
%
\begingroup
\settowidth{\leftmargin}{\textit{pattern}\code{\{}\textit{n}\code{,}\textit{m}\code{\}}}
\addtolength{\leftmargin}{1em}
\addtolength{\parskip}{-2pt}%
\begin{itemize}
\setlength{\itemsep}{0pt}%
\addtolength{\labelsep}{1em}%
\item[\code{(}\textit{pattern}\code{)}]
	Group subpatterns, and set backreferences.
\item[\code{\^{}}]
	Matches the beginning of a line.
\item[\code{\$}]
	Matches the end of a line.
\item[\code{.} (dot)]
	Matches any character except newline.
\item[\textit{pat1}\code{|}\textit{pat2}]
	Matches either \textit{pat1} or \textit{pat2}.
\item[\code{[}\textit{range}\code{]}]
	Matches any character in \textit{range}.
\item[\code{\bs}]
	Escapes the next character.
\item[\textit{pattern}\code{*}]
	Matches zero or more occurrences of \textit{pattern}.
\item[\textit{pattern}\code{+}]
	Matches one or more occurrences of \textit{pattern}.
\item[\textit{pattern}\code{?}]
	Matches zero or one occurrences of \textit{pattern}.
\item[\textit{pattern}\code{\{}\textit{n}\code{\}}]
	Matches exactly \textit{n} occurrences of \textit{pattern}.
\item[\textit{pattern}\code{\{}\textit{n}\code{,\}}]
	Matches at least \textit{n} occurrences of \textit{pattern}.
\item[\textit{pattern}\code{\{}\textit{n}\code{,}\textit{m}\code{\}}]
	Matches at least \textit{n} to \textit{m} occurrences of
	\textit{pattern}.
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Regular Expressions (cont.)}
%
\begingroup
\settowidth{\leftmargin}{\code{\bs t}, \code{\bs n}, \code{\bs r}}
\addtolength{\leftmargin}{1em}
\addtolength{\parskip}{-2pt}%
\begin{itemize}
\setlength{\itemsep}{0pt}%
\addtolength{\labelsep}{1em}%
\item[\code{*?}, \code{+?}, \code{??}]
	Non-greedy quantifiers.
\item[\code{(?\#}\textit{text}\code{)}]
	A comment. \textit{text} is ignored.
\item[\code{(?:}\textit{pattern}\code{)}]
	Groups, but doesn't make a backreference.
\item[\code{(?=}\textit{pattern}\code{)}]
	Zero-width, positive lookahead assertion.
\item[\code{(?!}\textit{pattern}\code{)}]
	Zero-width, negative lookahead assertion.
\item[\code{\bs w}, \code{\bs W}]
	Matches a word/non-word character.
\item[\code{\bs s}, \code{\bs S}]
	Matches a whitespace/non-whitespace character.
\item[\code{\bs d}, \code{\bs D}]
	Matches a digit/non-digit.
\item[\code{\bs b}, \code{\bs B}]
	Matches a word break/non-word break.
\item[\code{\bs t}, \code{\bs n}, \code{\bs r}]
	Tab, newline, carriage return.
\item[\code{\bs f}, \code{\bs a}, \code{\bs e}]
	Form feed, bell, escape.
\item[\code{\bs}\textit{n}]
	Matches the \textit{n}th parenthesized expression.
\item[\code{\bs 0}\textit{nnn}]
	Matches the octal character \textit{nnn}.
\item[\code{\bs x}\textit{nn}]
	Matches the hex character \textit{nn}.
\item[\code{\bs u}, \code{\bs l}]
	Convert the next character to upper/lower case (\code{ucfirst}, \code{lcfirst}).
\item[\code{\bs U}, \code{\bs L}]
	Convert to upper/lower case until \code{\bs E} (\code{uc}, \code{lc}).
\item[\code{\bs Q}]
	Escape (quote) metacharacters until \code{\bs E} (\code{quotemeta}).
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Extended Regexps}
%
\begin{itemize}
\item The \code{/x} option helps make regexps more readable.
\item Non-escaped whitespace is ignored.
\item \code{\#} introduces a comment.
\end{itemize}
%
\begingroup
\tiny
\begin{quote}
\begin{verbatim}
m/^                                 # Anchor beginning
 # Start with the day
 (mon|tue|wed|thu|fri|sat|sun)      # Day of the week
 \.?                                # Optional dot
 ,\s+                               # Comma, whitespace
 # Now try to match the date
 ((jan|mar|may|jul|aug|oct|dec)     # The 31-day months
        \s+                         # Whitespace
        (0?[1-9]        |           # 1-9 (01 also allowed)
         [12][0-9]      |           # 10-29
         3[01]                      # 30 and 31
        )
  | (apr|jun|sep|nov)               # The 30-day months
        \s+
        (0?[1-9]        |           # 1-9 (01 also allowed)
         [12][0-9]      |           # 10-29
         30                         # 30
        )
  | feb                             # February: we don't
                                    # allow leap years
        \s+
        (0?[1-9]        |           # 1-9 (01 also allowed)
         1[0-9]         |           # 10-19
         2[0-8]                     # 20-28
        )
 )
 # Finally, get the year
 (19)?\d{2}
$                                   # Anchor end
/xi
\end{verbatim}%$
\end{quote}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Regexp Special Variables}
%
\begingroup
%\addtolength{\parsep}{1em}
\setlength{\parsep}{2cm}
\begin{tabular}{rll}
& \code{\$\_} &
	\parbox[t]{4in}{The default variable to match.\hfil}\\ \\
& \code{\$}\textit{nn} &
	\parbox[t]{4in}{Matches the \textit{nn}th parenthesized	expression.\hfil}\\ \\
\code{\$MATCH} & \code{\$\&} &
	\parbox[t]{4in}{String that matched the last pattern.\hfil}\\ \\
\code{\$PREMATCH} & \code{\$`} &
	\parbox[t]{4in}{Text preceding that which matched the last pattern.\hfil}\\ \\
\code{\$POSTMATCH} & \code{\$'} &
	\parbox[t]{4in}{Text following that which matched the last pattern.\hfil}\\ \\
\hskip-1cm\code{\$LAST\_PAREN\_MATCH} & \code{\$+} &
	\parbox[t]{4in}{Text of the last parenthesized expression that matched something.\hfil}\\ \\
\end{tabular}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{\code{m//}}
%
\begin{normalsize}
\begin{quote}
\code{m/}\textit{pattern}\code{/}\textit{[options]}
\end{quote}
\end{normalsize}
\vskip1cm

\begin{itemize}
\item \code{m/}\textit{pattern}\code{/} returns true if \code{\$\_} matches \textit{pattern}.
\item \code{\$var =\tilde\ m/}\textit{pattern}\code{/} returns true if \code{\$var} matches \textit{pattern}.
\item \code{\$var !\tilde\ m/}\textit{pattern}\code{/} returns true if \code{\$var} does not match \textit{pattern}.
\item You can use any delimiter you like, instead of slashes.
\item If you do use slashes, you can omit the \code{m}.
\end{itemize}

Options:
\begingroup
%\addtolength{\parskip}{-2pt}%
\addtolength{\leftmargin}{1cm}
\setlength{\parskip}{0pt}
\begin{itemize}
%\setlength{\itemsep}{0pt}%
\addtolength{\labelsep}{1em}%
\item[\code{/i}]
	Case-insensitive matching.
\item[\code{/g}]
	Global pattern match: returns all matches in the string.
%\begin{tiny}
%%\begin{quote}
%\begin{verbatim}
%$_ = "a1b2c3";
%@numbers = /\d/g;   # Set @numbers to (1, 2, 3)
%\end{verbatim}%$
%%\end{quote}
%\end{tiny}

	\code{\bs G} anchors the spot where the last \code{m//g} left
	off.
\item[\code{/c}]
	Prevents \code{/g} from resetting on non-match.
\item[\code{/m}]
	This is a multi-line pattern. \code{\bs A} and \code{\bs Z}
	match the very beginning and very end of the string, but
	\code{\^} and \code{\$} match the beginning and end of every
	line.
%		Inside of \code{m//m}, you can use \code{\bs A} and
%	\code{\bs Z}. \code{\bs A} matches only the very beginning of
%	the string, and \code{\bs Z} matches only the very end.
\item[\code{/o}]
	Only compile the pattern once.
\item[\code{/s}]
	Treat the string as a single line: \code{.} will match newlines.
\item[\code{/x}]
	Enable extended regular expressions.
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{\code{s///}}
%
\begin{normalsize}
\begin{quote}
\code{s/}\textit{pattern}\code{/}\textit{replacement}\code{/}\textit{[options]}
\end{quote}
\end{normalsize}
\vskip1cm

\begin{itemize}
\item \code{s/}\textit{pat}\code{/}\textit{text}\code{/} replaces the first instance of \textit{pat} in \code{\$\_} with \textit{text}.
\item \code{\$var =\tilde\ s/}\textit{pat}\code{/}\textit{text}\code{/} replaces the first instance of \textit{pat} in \code{\$var} with \textit{text}.
\item You can use \code{\$1}, \code{\$2}, \code{\$\amp} etc. in the replacement text.
\item You can use delimiters other than slashes.
\item All of the options for \code{m//} work with \code{s///}.
\end{itemize}

\medskip
\begin{tiny}
\begin{quote}
\begin{verbatim}
$string = "ABCdef";
$string =~ s/^(...)/$1($1)/;    # Becomes "ABC(ABC)def"
\end{verbatim}
\end{quote}
\end{tiny}

Additional Option:
\begingroup
%\addtolength{\parskip}{-2pt}%
\addtolength{\leftmargin}{1cm}
\setlength{\parskip}{0pt}
\begin{itemize}
%\setlength{\itemsep}{0pt}%
\addtolength{\labelsep}{1em}%
\item[\code{/e}]
	Evaluates \textit{replacement} before substitution.\\
	Warning: \textit{replacement} is not parsed at compile-time.
\begin{tiny}
%\begin{quote}
\begin{verbatim}
# Replace uids with usernames
s/\d+/(getpwuid($&))[0]/eg;
\end{verbatim}%$
%\end{quote}
\end{tiny}
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{\code{tr///}}
%
\begin{normalsize}
\begin{quote}
\code{tr/}\textit{searchlist}\code{/}\textit{replacelist}\code{/}\textit{[options]}
\end{quote}
\end{normalsize}
\vskip1cm

\begin{itemize}
\item \code{tr/}\textit{search}\code{/}\textit{replace}\code{/}
	replaces all characters in \textit{search} with the
	corresponding ones from \textit{replace}, in \code{\$\_}.
\begin{tiny}
\begin{verbatim}
$header =~ tr/A-Z/a-z/;     # Convert $header to lowercase
\end{verbatim}
\end{tiny}
%
\item \code{\$var =\tilde\ 
	tr/}\textit{search}\code{/}\textit{replace}\code{/}: ditto,
	with \code{\$var} instead of \code{\$\_}.
\item You can use delimiters other than slashes.
\item \code{y///} is a synonym for \code{tr///}.
\end{itemize}

Options:
\begingroup
%\addtolength{\parskip}{-2pt}%
\addtolength{\leftmargin}{1cm}
\setlength{\parskip}{0pt}
\begin{itemize}
%\setlength{\itemsep}{0pt}%
\addtolength{\labelsep}{1em}%
\item[\code{/c}]
	Complement the search list.
\item[\code{/d}]
	Delete characters not in \textit{searchlist}.
\item[\code{/s}]
	Squash identical characters in the output.
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{\code{split} and \code{join}}
%
\begin{normalsize}
\begin{quote}
\code{split /}\textit{pattern}\code{/,} \textit{[string}\code{,} \textit{[limit]]}\\
\code{join }\textit{string}\code{,} \textit{array}
\end{quote}
\end{normalsize}
\vskip1cm

\begin{itemize}
\item \code{split} splits \textit{string} into sections delimited by
	\textit{pattern}, and returns the resulting list.
\begin{tiny}
\begin{verbatim}
split /:/, "staff:*:10:arensb, arnie"
        # Returns ("staff", "*", "10", "arensb, arnie")
\end{verbatim}
\end{tiny}

\item \code{join} concatenates the elements of \textit{array}, joined
	with \textit{string}, and returns the result.
\begin{tiny}
\begin{verbatim}
join(":", @fields);
\end{verbatim}
\end{tiny}
\item Warning: \code{split //} usually doesn't do what you want.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Functions}
%
\begin{itemize}
\item Define a function with \code{sub} \textit{name} \code{\{}
	\textit{body} \code{\}}
\item Declare a function with \code{sub} \textit{name}\code{;}
	(\textit{i.e.}, omit the body), or just by defining it before
	it's called.
\item \code{my \$var} declares a variable local to the enclosing
	block.
\item Arguments are given in \code{@\_}.
\item Return value(s) with \code{return}.
\end{itemize}
%
\begin{tiny}
\begin{quote}
\begin{verbatim}
sub dostuff {
        my $x = shift;          # First element of @_
        my $y;                  # Just a 'my' variable
        my @rest = @_;

        print "Hello, @rest\n";
        return $x + $y;
}

&dostuff(0, "friendly", "people");      # Explicit call
dostuff 0, "y'all!";                    # List operator call
\end{verbatim}%$
\end{quote}
\end{tiny}
%
\begin{itemize}
\item \code{\amp dostuff;} (no parens) recycles existing \code{@\_}.
\item Use \code{my}, not \code{local}.
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Function Prototypes}
%
\begin{itemize}
\item Prototype specifies how the function should be called.
\item It's a little picture of the call.
\end{itemize}
%
\begin{quote}
\begin{verbatim}
sub dostuff($$@) {
        my $x = shift;          # First element of @_
        my $y = shift;          # Next element of @_
        my @rest = @_;

        print "Hello, @rest\n";
        return $x + $y;
}

dostuff 1;                      # Wrong: causes error.
dostuff 1, 2, "world";          # Okay.
dostuff 3, @somearray;          # Okay.
\end{verbatim}
\end{quote}
%
\begin{itemize}
\item[\code{\$}] Indicates a scalar argument.
\item[\code{@}] Indicates an array argument.
\item[\code{\%}] Indicates a hash argument.
\item[\code{;}] Separates mandatory from optional arguments.
\item[\code{*}] Indicates a glob (usually a filehandle).
\end{itemize}
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Built-In Functions}
%
\begingroup
%\addtolength{\parskip}{-2pt}%
\settowidth{\leftmargin}{\code{ucfirst} \textit{expr}, \code{lcfirst} \textit{expr}}
%\setlength{\leftmargin}{10cm}
%\addtolength{\leftmargin}{1em}
\setlength{\parskip}{0pt}
\begin{itemize}
%\setlength{\itemsep}{0pt}%
\addtolength{\labelsep}{1em}%
\item[\code{chr} \textit{num}]
	Converts ASCII value to character.
\item[\code{ord} \textit{expr}]
	Converts character to ASCII value.
\item[\code{chmod} \textit{nnn}\code{,} \textit{files\ldots}]
	Changes the mode of \textit{files}.
\item[\code{chown} \textit{uuu}\code{,} \textit{ggg}\code{,} \textit{files\ldots}]
	Changes the owner of \textit{files}.
\item[\code{die} \textit{message}]
	Prints \textit{message} and exits.
\item[\code{warn} \textit{message}]
	Prints \textit{message} like \code{die}, but doesn't exit.
\item[\code{exit} \textit{code}]
	Exits the program with the given exit status.
\item[\code{exec} \textit{prog}\textit{[}\code{,} \textit{arg\ldots]}]
	\code{execvp()}s \textit{prog}.
\item[\code{system} \textit{list}]
	Executes a program and waits for it to exit.
\item[\code{grep} \textit{expr}\code{,} \textit{list}]
	Returns the elements of \textit{list} for which \textit{expr} is true.
\item[\code{map} \textit{expr}\code{,} \textit{list}]
	Returns the result of applying \textit{expr} to the elements of \textit{list}
\item[\code{sort} \textit{expr} \textit{list}]
	Sorts the elements of \textit{list} according to \textit{expr}.
\bigitem{\code{splice} \textit{array}\code{,} \textit{offset}\code{,} \textit{[length}\code{,} \textit{list]]}}
	Generalized list-substitution function.
\item[\code{uc} \textit{expr}, \code{lc} \textit{expr}]
	Converts \textit{expr} to upper/lower case.
\item[\code{ucfirst} \textit{expr}, \code{lcfirst} \textit{expr}]
	Converts the first character of \textit{expr} to upper/lower case.
\item[\code{int} \textit{expr}]
	Returns \textit{expr} as an integer.
\item[\code{hex} \textit{expr}]
	Returns the value of hex number \textit{expr}.
\item[\code{oct} \textit{expr}]
	Returns the value of octal (or hex) number \textit{expr}.
\item[\code{pack} \textit{template}\code{,} \textit{list}]
	Converts a list of values to a binary string.
\item[\code{unpack} \textit{template}\code{,} \textit{expr}]
	Parses a binary string into a list of values.
\item[\code{length} \textit{expr}]
	Returns the string length of \textit{expr}.
\bigitem{\code{printf} \textit{[FILEHANDLE]} \textit{format}\code{,} \textit{list}}
	C's \code{printf()}.
\bigitem{\code{sprintf} \textit{[FILEHANDLE]} \textit{format}\code{,} \textit{list}}
	C's \code{sprintf()}.
\item[\code{reverse} \textit{list}]
	Reverses an array or string.
\item[\code{select} \textit{[FILEHANDLE]}]
	Sets or returns the default filehandle.
\item[\code{substr} \textit{expr}\code{,} \textit{offset}\code{,} \textit{[len]}]
	Returns a substring of \textit{expr}.
% ``useless'' functions
\bigitem{\code{sysopen} \textit{filehandle}\code{,} \textit{filename}\code{,} \textit{mode}\code{,} \textit{[perm]}}
	\code{open(2)}.
\bigitem{\code{sysread} \textit{filehandle}\code{,} \textit{var}\code{,} \textit{len}\code{,} \textit{[offset]}}
	\code{read(2)}.
\bigitem{\code{syswrite} \textit{filehandle}\code{,} \textit{var}\code{,} \textit{len}\code{,} \textit{[offset]}}
	\code{write(2)}.
\item[\code{study} \textit{var}]
	Optimize pattern-matching on \textit{var}.
\item[\code{index} \textit{str}\code{,} \textit{substr [}\code{,} \textit{pos]}]
	Returns the first occurrence of \textit{substr} in \textit{str}.
\item[\code{rindex} \textit{str}\code{,} \textit{substr [}\code{,} \textit{pos]}]
	Returns the last occurrence of \textit{substr} in \textit{str}.
\item[\code{pos} \textit{var}]
	Where did \code{\$}\textit{scalar} \code{=\tilde\ m//g} leave off?
\item[\code{vec} \textit{expr}\code{,} \textit{offset}\code{,} \textit{bits}]
	Manipulate bit-fields.
\item[\code{getlogin}]
	Looks up the current username in \textsl{/etc/utmp}.
\item[\code{glob} \textit{expr}]
	Same as \code{<}\textit{file pattern}\code{>}.
\item[\code{reset} \textit{[expr]}]
	Resets certain matches, or variables beginning with
	\textit{expr}.
\end{itemize}
\endgroup
\end{slide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{slide}
\heading{Unix Functions}
%
\begingroup
\ttfamily
%\begin{tabular}{lllll}
\begin{tabular}{llll}
abs		& getpeername		& msgget	& shmread \\
accept		& getpgrp		& msgrcv	& shmwrite \\
atan2		& getppid		& msgsnd	& shutdown \\
bind		& getpriority		& opendir	& sin \\
chdir		& getprotobyname	& pipe		& sleep \\
chroot		& getprotobynumber	& rand		& socket \\
connect		& getprotoent		& readdir	& socketpair \\
cos		& getpwent		& readlink	& sprintf \\
crypt		& getpwnam		& recv		& sqrt \\
exp		& getpwuid		& rename	& srand \\
fcntl		& getservbyname		& rewinddir	& stat \\
fileno		& getservbyport		& rmdir		& symlink \\
flock		& getservent		& seek		& syscall \\
fork		& getsockname		& seekdir	& tell \\
getc		& getsockopt		& select	& telldir \\
getgrent	& gmtime		& semctl	& time \\
getgrgid	& ioctl			& semget	& times \\
getgrnam	& kill			& semop		& truncate \\
gethostbyaddr	& link			& send		& umask \\
gethostbyname	& listen		& setpgrp	& unlink \\
gethostent	& log			& setpriority	& utime \\
getnetbyaddr	& lstat			& setsockopt	& wait \\
getnetbyname	& mkdir			& shmctl	& waitpid \\
getnetent	& msgctl		& shmget	& \\
\end{tabular}
\endgroup
\end{slide}

\end{document}
