1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
6 <title>Unit Test: programlistingco.001</title>
7 <releaseinfo role="CVS">$Id: programlistingco.001.xml,v 1.2 2008-07-11 07:54:40 rt Exp $</releaseinfo>
8 <author><firstname>Norman</firstname><surname>Walsh</surname>
9 <affiliation><address><email>ndw@nwalsh.com</email></address></affiliation>
15 <area coords="1" id="prologue"/>
16 <area coords="4" id="skipeof"/>
17 <areaset coords="" id="xreq">
18 <area coords="9" id="require1"/>
19 <area coords="10" id="require2"/>
21 <area coords="11 12" id="use"/>
22 <area coords="27" id="funccall"/>
24 <programlisting>@rem = '--*-Perl-*--
26 perl.exe %_batchname %$
32 require 'n:/home/nwalsh/lib/cygnus.pl';
33 require 'timelocal.pl';
36 select (STDERR); $| = 1;
37 select (STDOUT); $| = 1;
39 @DIRS = ("/home/nwalsh/Mail");
43 while ($fname = readdir(DIR)) {
44 $file = "$dir/$fname";
46 next if $fname =~ /^\.\.?$/;
50 &compress ($file);
54 exit;</programlisting>
56 <callout arearefs="prologue">
57 <para>The prologue handles embedding a Perl script in a DOS batch file.</para>
59 <callout arearefs="skipeof">
60 <para>The <literal>goto</literal> statement, interpreted by the DOS batch
61 file interpreter, skips over the body of the Perl script.</para>
63 <callout arearefs="require1">
64 <para>The <literal>require</literal> statement sources in external program
67 <callout arearefs="use">
68 <para>The <literal>use</literal> statement is similar, but has additional
69 utility. It is a Perl5 function. (Note that this callout area specifies
70 both a line and a column.)</para>
72 <callout arearefs="funccall">
73 <para>This is a user subroutine call.</para>