Initial commit from the 2013 with minor fixes. From now and then,
[perlbook.git] / l42.tex
blob48d83927972f79ee21436b64cb09f7c9a7b9e8ee
1 \vbox{
2 \begin{framed}
3 \begin{internallinenumbers}
4 \noindent\verb2#!2\verb!/usr/bin/perl -w!\\
5 \verb!use strict;!\\
6 \verb!use warnings;!\\
7 \verb!my $text= 'Variable names in Perl can have several formats. Usually,!
9 \end{internallinenumbers}
10 \verb!they must begin with a letter or underscore, in which case they!
11 \verb!can be arbitrarily long (up to an internal limit of 251 characters)!
12 \verb!and may contain letters, digits, underscores, or the special!
13 \verb!sequence :: or \'. In this case, the part before the last :: or \'!
14 \verb!is taken to be a package qualifier; see perlmod.';!
16 \begin{internallinenumbers}
17 ~\\
18 \noindent
19 \verb!while ($text =~ /\b(\w{5,})\b/g)!\\
20 \verb! {!\\
21 \verb! print "$1\n";!\\
22 \verb! }!
23 \end{internallinenumbers}
24 \end{framed}
26 \label{lst:l42.pl}
27 \resetlinenumber