home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume28 / perlref / part01 < prev    next >
Encoding:
Text File  |  1992-02-25  |  56.0 KB  |  1,354 lines

  1. Newsgroups: comp.sources.misc
  2. From: jv@mh.nl (Johan Vromans)
  3. Subject:  v28i077:  perlref - Perl Reference Guide 4.019.1 [LaTeX and Postscript], Part01/03
  4. Message-ID: <csm-v28i077=perlref.115540@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 13160a47dcd886bdd3f352808b720726
  6. Date: Wed, 26 Feb 1992 17:58:07 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jv@mh.nl (Johan Vromans)
  10. Posting-number: Volume 28, Issue 77
  11. Archive-name: perlref/part01
  12. Environment: Perl, Postscript, Latex
  13.  
  14. Finally here it is: the new and updated version of the 
  15.  
  16.     Perl Reference Guide.
  17.  
  18. This version has been updated to match Perl 4.019.
  19.  
  20. Two ways to produce the Guide are included: a ready-to-print 
  21. PostScript version and a LaTeX source kit.
  22.  
  23. The Perl Reference Guide is a typeset quick reference guide to
  24. Larry Wall's Perl program.
  25.  
  26. It contains a concise description of all Perl 4.0 statements,
  27. functions, variables and lots of other useful information. 
  28. The Guide is based on Perl version 4.0, patchlevel 19.
  29.  
  30. The purpose of the Reference Guide is to aid in the use of Perl, to
  31. look up the syntax of specific functions, statements and the meaning
  32. of built-in variables.  It is *NOT* a self-contained user guide -
  33. basic knowledge of the Perl language is required. It is *NOT* complete
  34. - some of the more obscure variants of perl constructs have been left
  35. out.  But all functions and variables are mentioned in at least one
  36. way they can be used.
  37.  
  38. Happy hacking!
  39.  
  40.     Johan
  41.  -- 
  42. Johan Vromans                       jv@mh.nl via internet backbones
  43. Multihouse Automatisering bv               uucp:..!{uunet,sun4nl}!mh.nl!jv
  44. Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62911/62500
  45. ------------------------
  46. #!/bin/sh
  47. # This is a shell archive (produced by shar 3.49)
  48. # To extract the files from this archive, save it to a file, remove
  49. # everything above the "!/bin/sh" line above, and type "sh file_name".
  50. #
  51. # existing files will NOT be overwritten unless -c is specified
  52. #
  53. # This is part 1 of a multipart archive                                    
  54. # do not concatenate these parts, unpack them in order with /bin/sh        
  55. #
  56. # This shar contains:
  57. # length  mode       name
  58. # ------ ---------- ------------------------------------------
  59. #   2057 -rw-r--r-- ChangeLog
  60. #   1112 -rw-r--r-- Layout
  61. #   2839 -r--r--r-- Makefile
  62. #   6524 -r--r--r-- README
  63. #   4291 -r--r--r-- parr
  64. #  84662 -rw-r--r-- refbase.ps
  65. #   6963 -r--r--r-- refbase.sty
  66. #  47244 -rw-r--r-- refbase.tex
  67. #
  68. if test -r _shar_seq_.tmp; then
  69.     echo 'Must unpack archives in sequence!'
  70.     echo Please unpack part `cat _shar_seq_.tmp` next
  71.     exit 1
  72. fi
  73. # ============= ChangeLog ==============
  74. if test -f 'ChangeLog' -a X"$1" != X"-c"; then
  75.     echo 'x - skipping ChangeLog (File already exists)'
  76.     rm -f _shar_wnt_.tmp
  77. else
  78. > _shar_wnt_.tmp
  79. echo 'x - extracting ChangeLog (Text)'
  80. sed 's/^X//' << 'SHAR_EOF' > 'ChangeLog' &&
  81. Wed Feb 19 15:02:26 1992  Johan Vromans  (jv at largo)
  82. X
  83. X    * refbase.sty: add support for new font selection scheme.
  84. X      Get rid of overfull hboxes.
  85. X
  86. X    * refbase.sty, refmaster.tex, ch*.tex: update for 4.019.
  87. X      Add description for "sort { EXPR;...} @array" .
  88. X      Describe "eval { ... }" .
  89. X      Add "scalar(@array)" and "scalar(%array)" .
  90. X      Small corrections.
  91. X
  92. X    * Makefile: new kit assembly.
  93. X
  94. Tue Aug 27 18:41:42 1991  Johan Vromans  (jv at largo)
  95. X
  96. X    * ch22: add 'gethostbyaddr'
  97. X
  98. Fri Aug  2 09:44:47 1991  Johan Vromans  (jv at largo)
  99. X
  100. X    * parr: add code for duplex printing.
  101. X
  102. X    * README: describe duplex printing, version number.
  103. X
  104. Sat Jul 27 15:23:01 1991  Johan Vromans  (jv at pronto)
  105. X
  106. X    * parr: Adjusted '%%Pages:' to reflect actual number of sheets.
  107. X
  108. Fri Jul 26 23:10:00 1991  Johan Vromans  (jv at pronto)
  109. X
  110. X    * Add Layout document that describes in more detail how the
  111. X      Reference Guide should look like.
  112. X
  113. X    * Makefile/README: Incorporate Layout.
  114. X
  115. Fri Jul 26 09:15:58 1991  Johan Vromans  (jv at largo)
  116. X
  117. X    * Released to USEnet (patch). Official version is 4.010.2.1.
  118. X
  119. X    * ch04: typo: | -> || (two locations)
  120. X
  121. X    * parr: slightly increase $topmargin for US paper.
  122. X
  123. X    * ch06: typo: log or/and | & -> || &&
  124. X
  125. Thu Jul 25 11:11:24 1991  Johan Vromans  (jv at largo)
  126. X
  127. X    * Makefile/README: Clarify the use of guide-{odd,even?}.ps.
  128. X
  129. X    * parr: Suppress extraneous %%Page comments to obtain more
  130. X      conformant PostScript. Some PS viewers and printers (or
  131. X      print-spoolers) seem to choke in these extraneous comments.
  132. X
  133. X      Set $leftmargin to 0 for US-Letter format. According to most
  134. X      respondents this seems to be the correct value.
  135. X
  136. Tue Jul 23 18:32:54 1991  Johan Vromans  (jv at largo)
  137. X
  138. X    * Makefile: allow MASTER=test for testing.
  139. X
  140. X    * ch03: typo: $var -> $#var is last element of array.
  141. X
  142. X    * ch00: move front page info a bit down/right.
  143. X
  144. Mon Jul 22 22:05:57 1991  Johan Vromans  (jv at pronto)
  145. X
  146. X    * ch00: typo: deigned -> designed.
  147. X
  148. Sat Jul 20 00:31:47 1991  Johan Vromans  (jv at pronto)
  149. X
  150. X    * Released to USEnet. Official version is 4.010.1.8.
  151. X
  152. X    * This is a brand new version.
  153. X
  154. SHAR_EOF
  155. chmod 0644 ChangeLog ||
  156. echo 'restore of ChangeLog failed'
  157. Wc_c="`wc -c < 'ChangeLog'`"
  158. test 2057 -eq "$Wc_c" ||
  159.     echo 'ChangeLog: original size 2057, current size' "$Wc_c"
  160. rm -f _shar_wnt_.tmp
  161. fi
  162. # ============= Layout ==============
  163. if test -f 'Layout' -a X"$1" != X"-c"; then
  164.     echo 'x - skipping Layout (File already exists)'
  165.     rm -f _shar_wnt_.tmp
  166. else
  167. > _shar_wnt_.tmp
  168. echo 'x - extracting Layout (Text)'
  169. sed 's/^X//' << 'SHAR_EOF' > 'Layout' &&
  170. This is the layout of the pages of the reference guide
  171. X
  172. X
  173. X            center of paper
  174. X              |
  175. X    +-----------------+-----------------+
  176. X    |                           <----------- top margin
  177. X    |     xxxxxxxxxx  :  xxxxxxxxxx     |
  178. X    |     xxxxxxxxxx     xxxxxxxxxx     |
  179. X    |     xxxxxxxxxx     xxxxxxxxxx     |
  180. X    |     xxxxxxxxxx     xxxxxxxxxx     |
  181. X    |     xxxxxxxxxx     xxxxxxxxxx  <------ right margin
  182. X    |     xxxxxxxxxx     xxxxxxxxxx     |
  183. X    |     xxxxxxxxxx     xxxxxxxxxx     |
  184. X    | ^   xxxxxxxxxx     xxxxxxxxxx     |
  185. X    | |   xxxxxxxxxx     xxxxxxxxxx     |
  186. X    | |   xxxxxxxxxx  :  xxxxxxxxxx     |
  187. X    | |                                 |
  188. X    +-|---------------------------------+
  189. X      |
  190. X     left margin
  191. X
  192. X
  193. These are the values:
  194. X            A4 (cm)        US Letter (inch)
  195. X    text width         9.0        3.5        same for both
  196. X    text height        19.2        7.5        same for both
  197. X    top margin          1.0        0.5
  198. X    left margin         4.9        1.6
  199. X    right margin     4.9        1.6
  200. X    space between     2.0        0.8        same for both
  201. X
  202. After printing double-sided, the pages can be stapled (the ":" in the
  203. picture), folded, and the excess margins cut off. Personally, I cut it
  204. to 10.6 cm (4.2 inch).
  205. SHAR_EOF
  206. chmod 0644 Layout ||
  207. echo 'restore of Layout failed'
  208. Wc_c="`wc -c < 'Layout'`"
  209. test 1112 -eq "$Wc_c" ||
  210.     echo 'Layout: original size 1112, current size' "$Wc_c"
  211. rm -f _shar_wnt_.tmp
  212. fi
  213. # ============= Makefile ==============
  214. if test -f 'Makefile' -a X"$1" != X"-c"; then
  215.     echo 'x - skipping Makefile (File already exists)'
  216.     rm -f _shar_wnt_.tmp
  217. else
  218. > _shar_wnt_.tmp
  219. echo 'x - extracting Makefile (Text)'
  220. sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
  221. # @(#)@ Makefile 4.2.6 - Makefile for Perl Reference Guide
  222. X
  223. # This Makefile requires perl to be in your PATH.
  224. X
  225. SHELL    = /bin/sh
  226. X
  227. # Delete the next line if you use US Letter paper format
  228. PAPER    = -a4
  229. X
  230. all:    refguide.ps
  231. X
  232. 2pass:    guide-odd.ps guide-even1.ps guide-even2.ps
  233. X
  234. # 2 pages per page, suitable for centrefold printing.
  235. refguide.ps:    refbase.ps parr
  236. X    perl ./parr $(PAPER) \
  237. X        -o 21,2,3,20,19,4,5,18,17,6,7,16,15,8,9,14,13,10,11,12 \
  238. X        refbase.ps > refguide.ps
  239. X
  240. # Odd and even passes for centerfold printing. 
  241. # First print guide-odd.ps, then find out which of the others to use.
  242. # guide-even1.ps is for printers with correct output stacking like
  243. # Apple LaserWriter II. 
  244. # guide-even2.ps for printers with reverse output stacking, like old
  245. # Apple LaserWriters. 
  246. X
  247. guide-odd.ps:    refbase.ps parr
  248. X    perl ./parr $(PAPER) \
  249. X        -o 21,2,19,4,17,6,15,8,13,10 refbase.ps > guide-odd.ps
  250. X
  251. guide-even1.ps:    refbase.ps parr
  252. X    perl ./parr $(PAPER) \
  253. X        -o 11,12,9,14,7,16,5,18,3,20 refbase.ps > guide-even1.ps
  254. X
  255. guide-even2.ps:    refbase.ps parr
  256. X    perl ./parr $(PAPER) \
  257. X        -o 3,20,5,18,7,16,9,14,11,12 refbase.ps > guide-even2.ps
  258. X
  259. clean:
  260. X    rm -f refguide.ps guide-odd.ps guide-even1.ps guide-even2.ps \
  261. X        refbase.dvi core *~
  262. X
  263. # For maintenance use only ...
  264. X
  265. VER    = 4.019
  266. X
  267. CH    = ch00.tex ch01.tex ch02.tex ch03.tex ch04.tex ch05.tex \
  268. X      ch06.tex ch07.tex ch08.tex ch09.tex ch10.tex ch11.tex \
  269. X      ch12.tex ch13.tex ch14.tex ch15.tex ch16.tex ch17.tex \
  270. X      ch18.tex ch19.tex ch20.tex ch21.tex ch22.tex ch23.tex \
  271. X      ch24.tex ch25.tex ch26.tex \
  272. X      ch99.tex
  273. SRC    = refbase.tex refbase.sty
  274. AUX    = README ChangeLog Makefile parr Layout
  275. X
  276. # Our TeX places its output here, never mind if yours doesn't.
  277. TEXTMP = /usr/tmp/$(USER)TeX.
  278. X
  279. # NOTE: DO NOT REMOVE OR CHANGE '-ta4' EVEN IF USING NON-A4 PAPER
  280. refbase-ps:    refbase.dvi
  281. X    dvips -r0 -ta4 refbase.dvi 
  282. X    -if [ -f psneat.pl ]; then \
  283. X        mv refbase.ps refbase.ps~; \
  284. X        perl ./psneat.pl refbase.ps~ > refbase.ps; \
  285. X    fi
  286. X
  287. refbase.dvi:    $(SRC)
  288. X    latex refbase.tex < /dev/null
  289. X    -if [ -f $(TEXTMP)dvi ]; then \
  290. X        mv $(TEXTMP)dvi refbase.dvi; \
  291. X    fi
  292. X
  293. MASTER  = ref
  294. refbase-tex:  $(MASTER)master.tex $(CH) makebase.pl
  295. X    perl ./makebase.pl $(REV) $(MASTER)master.tex > refbase.tex
  296. X
  297. kit:    
  298. X    REV=`cat Revision.SEQ`; \
  299. X    expr $$REV + 1 >Revision.SEQ; \
  300. X    (echo ""; echo Revision: $(VER).$$REV; what $(SRC) $(CH)) >> Revision; \
  301. X    $(MAKE) -$(MAKEFLAGS) REV=$$REV refbase-tex refbase-ps kitinternal
  302. X
  303. kitinternal:
  304. X    rm -f perlref_shr.* perlref_ltx.* perlref-$(VER).$(REV).tar.Z
  305. X    shar -c -n perlref-$(VER).$(REV) -a -s 'jv@mh.nl' \
  306. X        -o perlref-$(VER).$(REV)_shr -L30 -f $(AUX) refbase.ps
  307. X    shar -c -n perlltx-$(VER).$(REV) -a -s 'jv@mh.nl' \
  308. X        -o perlref-$(VER).$(REV)_ltx -L30 -f $(AUX) $(SRC)
  309. X    pdtar -zcvf perlref-$(VER).$(REV).tar.Z $(AUX) $(SRC) refbase.ps
  310. X    ls -l perlref-*_shr.* perlref-*_ltx.* perlref-*.tar.Z
  311. X
  312. ident:
  313. X    what $(AUX) $(SRC)
  314. SHAR_EOF
  315. chmod 0444 Makefile ||
  316. echo 'restore of Makefile failed'
  317. Wc_c="`wc -c < 'Makefile'`"
  318. test 2839 -eq "$Wc_c" ||
  319.     echo 'Makefile: original size 2839, current size' "$Wc_c"
  320. rm -f _shar_wnt_.tmp
  321. fi
  322. # ============= README ==============
  323. if test -f 'README' -a X"$1" != X"-c"; then
  324.     echo 'x - skipping README (File already exists)'
  325.     rm -f _shar_wnt_.tmp
  326. else
  327. > _shar_wnt_.tmp
  328. echo 'x - extracting README (Text)'
  329. sed 's/^X//' << 'SHAR_EOF' > 'README' &&
  330. X                 INTRODUCTION
  331. X                 ============
  332. X
  333. X             The Perl 4.0 Reference Guide
  334. X
  335. X            Revised: 92/02/19
  336. X
  337. The Perl Reference Guide is a typeset quick reference guide to
  338. Larry Wall's Perl program.
  339. X
  340. It contains a concise description of all Perl 4.0 statements,
  341. functions, variables and lots of other useful information. 
  342. The Guide is based on Perl version 4.0, patchlevel 19.
  343. X
  344. The purpose of the Reference Guide is to aid in the use of Perl, to
  345. look up the syntax of specific functions, statements and the meaning
  346. of built-in variables.  It is *NOT* a self-contained user guide -
  347. basic knowledge of the Perl language is required. It is *NOT* complete
  348. - some of the more obscure variants of perl constructs have been left
  349. out.  But all functions and variables are mentioned in at least one
  350. way they can be used.
  351. X
  352. The Reference Guide is designed and created by Johan Vromans using the
  353. LaTex typesetting system. For best results, Tom Rockiki's dvips 5.47
  354. should be used to generate the PostScript output.
  355. Your mileage may vary when you use other ouput mechanisms.
  356. X
  357. A special formatting tool, written in Perl, makes it possible to
  358. reformat this PostScript output for reproduction in a number of
  359. formats.  If you cannot run this tool, you do not need the
  360. information either.
  361. X
  362. The version number of the Reference Guide is coupled to the version of
  363. Perl, e.g. 4.019.2 means: the third release suitable for perl 4
  364. patchlevel 19. 
  365. X
  366. INSTALLATION
  367. ============
  368. X
  369. X 1. Unload the distribution
  370. X
  371. X    After unloading the distribution, you will have the following files:
  372. X
  373. X    README        - this file
  374. X    ChangeLog   - description of changes
  375. X    Makefile    - make file
  376. X    parr        - reformat and rearrange tool
  377. X    Layout        - description of the format
  378. X
  379. X    The LeTeX kit includes
  380. X
  381. X    refbase.tex - LaTeX source for the Reference Guide
  382. X    refbase.sty - LaTeX style for the Reference Guide
  383. X
  384. X    The PostScript kit includes
  385. X
  386. X    refbase.ps  - pre-generated PostScript base
  387. X
  388. X 2. Create the PostScript base file
  389. X
  390. X    You can skip this step if you already have a pre-generated
  391. X    PostScript base file.
  392. X    This step requires the LaTeX typesetting system, and dvips version
  393. X    5.47 or later.
  394. X
  395. X    - Use "make refbase-ps" (a dash, not a dot) to create a new
  396. X      PostScript file from the LaTeX source. This file can be printed
  397. X      normally. 
  398. X
  399. X    NOTE: dvips must be instructed to use a4 format paper ('-t a4')
  400. X      even if you intend to print on a different format!
  401. X
  402. X 3. Create the RefGuide from the PostScript base
  403. X
  404. X    As distributed, the Makefile is configured to generate output for
  405. X    A4 (21 x 29.7 cm) paper format. Use "make PAPER= ..." to select US
  406. X    Letter (8.5 x 11") format.  Both formats should be printable on
  407. X    all industry-standard PostScript printers.
  408. X
  409. X    You can use "make" to generate a new PostScript file for one of
  410. X    the following formats:
  411. X
  412. X     - Use "make refguide.ps" to create a guide formatted in 10 pages
  413. X       of 2-column text. It should be printed double-sided, stapled in
  414. X       the middle, folded, and cut to size to have a 16-page 3.5 x 8"
  415. X       booklet.
  416. X
  417. X     - Use "make 2pass" to create a set of odd and even pages for
  418. X       double sided printing. First print "guide-odd.ps". Then put the
  419. X       paper back in the tray, and print either "guide-even1.ps" or
  420. X       "guide-even2.ps", depending on the way your printer arranges
  421. X       the printed paper.
  422. X       "guide-even1.ps" is for printers with correct output stacking like
  423. X       Apple LaserWriter II. 
  424. X       "guide-even2.ps" is for printers with reverse output stacking,
  425. X       like old Apple LaserWriters. 
  426. X       In other words, after printing "guide-odd.ps", if the
  427. X       text of the cover page is on top -- use "guide-even1.ps".
  428. X       But if you're looking at the text of pages 9/10 -- use
  429. X       "guide-even2.ps". 
  430. X
  431. X    "make" without arguments will default to refguide.ps .
  432. X
  433. X    If your printout is not correct, feel free to change the figures in
  434. X    subroutine 'twoup' of the 'parr' program. The file Layout
  435. X    describes in more detail how the Guide should look like.
  436. X
  437. X    On printers that support it, duplex printing is done.
  438. X
  439. Comments are welcome, send them to the author.
  440. X
  441. IF YOU DON'T HAVE A POSTSCRIPT PRINTER
  442. ======================================
  443. X
  444. Look in perlref.sty for comments with ">>>>" as a guide.  The output
  445. will not be as perfect, but still very useful.
  446. X
  447. HISTORY
  448. =======
  449. X
  450. The first version of the Reference Guide --"reference card" is was
  451. called then-- appeared in 1989 with perl version 2.0. It was created
  452. using an Apple Macintosh and the RagTime DeskTop publishing tool.
  453. It was 9 pages, I believe. The PostScript output was extracted from
  454. the Mac and hacked for 'normal' use with the macps program.
  455. X
  456. With perl version 3 came the next version. A 15-page card format, and
  457. a 16-page reference guide. This time, the Guide was created using
  458. MicroSoft Word, still on Macintosh. Tools were supplied to manipulate
  459. the PostScript file to suit different printing formats.
  460. In a later version, the card format was abandoned.
  461. X
  462. Next came the Camel version, with perl 4.0. Lots of measurements had
  463. been taken to have the abundance of new functions fit on 16 pages.
  464. X
  465. After the book appeared, I decided to rework the Guide to use more
  466. pages, and different styles and fonts for clarity. I reworked the
  467. MS-Word version, to find out that the resultant PostScript file had
  468. increased from 90Kb to 180Kb! 
  469. So I decided to start again, from scratch (well, almost) using the
  470. LaTeX typesetting system. The resultant PostScript file is now 80Kb,
  471. while it prints out almost identical to the 180Kb MS-Word version.
  472. X
  473. CREDITS
  474. =======
  475. X
  476. The Perl Reference Guide is copyrighted by the author. It may be
  477. reproduced, printed and distributed freely, as long as the original
  478. author gets the credits, and the copyright notice is not removed from
  479. the text. It may not be turned into a commercial product except with
  480. written permission of the author.
  481. X
  482. ---------------------------- author info -----------------------------
  483. X                Johan Vromans
  484. X Multihouse Research, Doesburgweg 7, 2803 PL  Gouda, the Netherlands
  485. X           tel. +31 1820 62911, fax. +31 1820 62500
  486. X              email: <jv@mh.nl>
  487. ----------------------------------------------------------------------
  488. X
  489. I like to thank everyone who has helped me (and encouraged me) to get
  490. the job done, and to get the results to you. Especially Tom
  491. Christiansen and JGreely (for "parr") And Larry Wall, of course,
  492. without whom I would have spent lots of time annoying myself.
  493. X
  494. X
  495. -- PostScript is a trademark of Adobe, I assume.
  496. @(#)@ README    4.2.4
  497. SHAR_EOF
  498. chmod 0444 README ||
  499. echo 'restore of README failed'
  500. Wc_c="`wc -c < 'README'`"
  501. test 6524 -eq "$Wc_c" ||
  502.     echo 'README: original size 6524, current size' "$Wc_c"
  503. rm -f _shar_wnt_.tmp
  504. fi
  505. # ============= parr ==============
  506. if test -f 'parr' -a X"$1" != X"-c"; then
  507.     echo 'x - skipping parr (File already exists)'
  508.     rm -f _shar_wnt_.tmp
  509. else
  510. > _shar_wnt_.tmp
  511. echo 'x - extracting parr (Text)'
  512. sed 's/^X//' << 'SHAR_EOF' > 'parr' &&
  513. #!/usr/bin/perl
  514. X
  515. # @(#)@ parr 4.2.3
  516. X
  517. # rearrange conforming PS code to print the pages in an arbitrary
  518. # order.  The -o option takes a list of ranges, like this:
  519. #    1-5    1-10,11-20    11-,1-10
  520. # usage: parr [-a4] [-o list] [file]
  521. #
  522. # jgreely@cis.ohio-state.edu, 89/10/23
  523. # modified by jv@mh.nl, 91/078/15
  524. X
  525. $order='';
  526. $signFlag='';
  527. $signCount=0;
  528. $DEBUG=0;
  529. $TMPDIR='/usr/tmp';
  530. X
  531. while ($_ = $ARGV[0],/^-/) {
  532. X    shift;
  533. X    last if /^-\-$/;
  534. X    /^-o(rder)?$/ && ($order = shift,next);
  535. X    /^-a4$/ && ($a4flag++,next);
  536. X    die "usage: parr [-a4] [-order list] [file]\n";
  537. }
  538. X
  539. $file = "$TMPDIR/p$$.header";
  540. @files = ($file);
  541. $sheet=0;
  542. open(FILE,">$file") || die "$file: $!\n";
  543. while (<>) {
  544. X    #
  545. X    # hack to use NeXT Preview: strip old '%%Pages:' lines
  546. X    #
  547. X    next if /^%%Pages:/;
  548. X    if (/^%%Page:/) {
  549. X        $sheet++;
  550. X        $pagemap{$sheet} = $1 if /%%Page:\s+(\S+)\s+\S+/;
  551. X        close(FILE);
  552. X        $file = "$TMPDIR/p$$.$sheet";
  553. X        push(@files,$file);
  554. X        open(FILE,">$file") || die "$file: $!\n";
  555. X    }
  556. X    if (/^%%Trailer/) {
  557. X        close(FILE);
  558. X        $file = "$TMPDIR/p$$.trailer";
  559. X        push(@files,$file);
  560. X        open(FILE,">$file") || die "$file: $!\n";
  561. X    }
  562. X    if (/^TeXDict begin @(a4|letter)/) {
  563. X        # Insert twoup before switching to TeXDict
  564. X        &twoup;
  565. X        $twoup++;
  566. X        &double_sided;
  567. X        print FILE "TeXDict begin @landscape\n";
  568. X        next;
  569. X    }
  570. X    print FILE $_;
  571. }
  572. close(FILE);
  573. die "twoup insertion error\n" unless $twoup == 1;
  574. X
  575. @order = ();
  576. if ($order) {
  577. X    foreach $range (split(/,/,$order)) {
  578. X        ($start,$sep,$end) = split(/(-)/,$range);
  579. X        $start = 1 unless $start;
  580. X        $end = $sheet unless $end;
  581. X        if ($sep) {
  582. X            push(@order,$start..$end);
  583. X        }else{
  584. X            push(@order,$start);
  585. X        }
  586. X    }
  587. }elsif ($signFlag) {
  588. X    if (! $signCount) {
  589. X        $signCount = $sheet;
  590. X        $signCount += (4 - $sheet % 4) if ($sheet % 4);
  591. X    }else{
  592. X        $signCount *=4;
  593. X    }
  594. X    for($base=0;$base<$sheet;$base+=$signCount) {
  595. X        @tmp = ($signCount/2+$base);
  596. X        push(@tmp,$tmp[0]+1,$tmp[0]+2,$tmp[0]-1);
  597. X        while ($tmp[3] > $base) {
  598. X            push(@order,@tmp);
  599. X            @tmp = ($tmp[0]-2,$tmp[1]+2,$tmp[2]+2,$tmp[3]-2);
  600. X        }
  601. X    }
  602. }else{
  603. X    @order = (1..$sheet);
  604. }
  605. X
  606. @tmp=@order;
  607. @order=();
  608. foreach $page (@tmp) {
  609. X    push(@order,$page > $sheet ? "B" : $page);
  610. }
  611. X
  612. open(FILE,"$TMPDIR/p$$.header");
  613. $_ = <FILE>;
  614. print $_,"%%Pages: (atend)\n";
  615. print while <FILE>;
  616. close(FILE);
  617. X
  618. $count = 0;
  619. foreach $page (@order) {
  620. X    $count++;
  621. X    $num = "?";
  622. X    $num = $pagemap{$page} if defined $pagemap{$page};
  623. X    $num .= "/" . $pagemap{$order[$count]} 
  624. X        if defined $pagemap{$order[$count]};
  625. X    print "%%Page: $num ", ($count+1)/2, "\n" if $count & 1;
  626. X    print "%%OldPage: $page\n";
  627. X    if ($page eq "B") {
  628. X        print "showpage\n";
  629. X    }else{
  630. X        open(FILE,"$TMPDIR/p$$.$page");
  631. X        while (<FILE>) {
  632. X            print unless /^%%Page:/;
  633. X        }
  634. X        close(FILE);
  635. X    }
  636. }
  637. open(FILE,"$TMPDIR/p$$.trailer");
  638. print while <FILE>;
  639. close(FILE);
  640. print "%%Pages: ", int(($count+1)/2), " 0\n";
  641. X
  642. unlink @files unless $DEBUG;
  643. exit(0);
  644. X
  645. sub twoup {
  646. $factor = 0.707106781187;
  647. X
  648. # Measurements are in 1/100 inch approx.
  649. if ( $a4flag) {
  650. X    $topmargin = -57;
  651. X    $leftmargin = 28;
  652. X    $othermargin = 445;    # do not change -- relative to $leftmargin
  653. }
  654. else {
  655. X    $topmargin = -30;
  656. X    $leftmargin = 0;
  657. X    $othermargin = 445;    # do not change -- relative to $leftmargin
  658. }
  659. $vsize = -1 - $factor;
  660. print FILE <<EOD;
  661. /isoddpage true def
  662. /orig-showpage /showpage load def
  663. /showpage {
  664. X        isoddpage not { orig-showpage } if
  665. X        /isoddpage isoddpage not store 
  666. X    } def
  667. /bop-hook {
  668. X    /vsize $vsize def
  669. X        isoddpage 
  670. X    { $factor $factor scale $topmargin $leftmargin translate }
  671. X        { 0 $othermargin translate}
  672. X    ifelse
  673. X    } def
  674. /end-hook{ isoddpage not { orig-showpage } if } def
  675. EOD
  676. }
  677. X
  678. sub double_sided {
  679. X
  680. X    # From: Tim Huckvale <tjh@praxis.co.uk>
  681. X    #
  682. X    # You may be interested in the following problem, and fix, that we
  683. X    # found when attempting to print the reference card on our Hewlett
  684. X    # Packard Laser-Jet IIISi printer.
  685. X    # 
  686. X    # On this printer, refguide.ps prints double-sided with the
  687. X    # reverse side of each sheet upside down.  We fixed it with the
  688. X    # following patch, applied before printing.
  689. X
  690. X    # From: Johan Vromans <jv@mh.nl>
  691. X    #
  692. X    # Okay -- consider this an unsupported feature.
  693. X
  694. X    print FILE <<EOD;
  695. statusdict /setduplexmode known { statusdict begin true setduplexmode end } if
  696. statusdict /settumble known { statusdict begin true settumble end } if
  697. EOD
  698. }
  699. X
  700. # Local Variables:
  701. # mode:(perl)
  702. # End:
  703. SHAR_EOF
  704. chmod 0444 parr ||
  705. echo 'restore of parr failed'
  706. Wc_c="`wc -c < 'parr'`"
  707. test 4291 -eq "$Wc_c" ||
  708.     echo 'parr: original size 4291, current size' "$Wc_c"
  709. rm -f _shar_wnt_.tmp
  710. fi
  711. # ============= refbase.ps ==============
  712. if test -f 'refbase.ps' -a X"$1" != X"-c"; then
  713.     echo 'x - skipping refbase.ps (File already exists)'
  714.     rm -f _shar_wnt_.tmp
  715. else
  716. > _shar_wnt_.tmp
  717. echo 'x - extracting refbase.ps (Text)'
  718. sed 's/^X//' << 'SHAR_EOF' > 'refbase.ps' &&
  719. %!PS-Adobe-2.0
  720. %%Creator: dvips 5.47 Copyright 1986-91 Radical Eye Software
  721. %%Title: refbase.dvi
  722. %%Pages: 21 1
  723. %%BoundingBox: 0 0 596 843
  724. %%DocumentFonts: Helvetica-BoldOblique Helvetica-Bold Times-Roman Courier-Bold
  725. %%+ Helvetica Times-Italic
  726. %%EndComments
  727. %%BeginProcSet: tex.pro
  728. /TeXDict 200 dict def TeXDict begin /N /def load def /B{bind def}N /S /exch
  729. load def /X{S N}B /TR /translate load N /isls false N /vsize 10 N /@rigin{
  730. isls{[0 1 -1 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
  731. Resolution VResolution vsize neg mul TR matrix currentmatrix dup dup 4 get
  732. round 4 exch put dup dup 5 get round 5 exch put setmatrix}N /@letter{/vsize 10
  733. N}B /@landscape{/isls true N /vsize -1 N}B /@a4{/vsize 10.6929133858 N}B /@a3{
  734. /vsize 15.5531 N}B /@ledger{/vsize 16 N}B /@legal{/vsize 13 N}B /@manualfeed{
  735. statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0 0]N
  736. /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{/nn 8 dict N nn begin
  737. /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X array
  738. /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo setfont}2
  739. array copy cvx N load 0 nn put /ctr 0 N[}B /df{/sf 1 N /fntrx FMat N df-tail}
  740. B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]N df-tail}B /E{pop nn dup definefont
  741. setfont}B /ch-width{ch-data dup length 5 sub get}B /ch-height{ch-data dup
  742. length 4 sub get}B /ch-xoff{128 ch-data dup length 3 sub get sub}B /ch-yoff{
  743. ch-data dup length 2 sub get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B
  744. /ch-image{ch-data dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0
  745. N /rw 0 N /rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S
  746. dup /base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0
  747. ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice
  748. ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]{ch-image}
  749. imagemask restore}B /D{/cc X dup type /stringtype ne{]}if nn /base get cc ctr
  750. put nn /BitMaps get S ctr S sf 1 ne{dup dup length 1 sub dup 2 index S get sf
  751. div put}if put /ctr ctr 1 add N}B /I{cc 1 add D}B /bop{userdict /bop-hook
  752. known{bop-hook}if /SI save N @rigin 0 0 moveto}N /eop{clear SI restore
  753. showpage userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook
  754. known{start-hook}if /VResolution X /Resolution X 1000 div /DVImag X /IE 256
  755. array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for}N /p /show load N
  756. /RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X
  757. /rulex X V}B /V statusdict begin /product where{pop product dup length 7 ge{0
  758. 7 getinterval(Display)eq}{pop false}ifelse}{false}ifelse end{{gsave TR -.1 -.1
  759. TR 1 1 scale rulex ruley false RMat{BDot}imagemask grestore}}{{gsave TR -.1
  760. -.1 TR rulex ruley scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /a{
  761. moveto}B /delta 0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{
  762. S p tail}B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B
  763. /j{3 M}B /k{4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w
  764. }B /q{p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p
  765. a}B /bos{/SS save N}B /eos{clear SS restore}B end
  766. %%EndProcSet
  767. %%BeginProcSet: texps.pro
  768. TeXDict begin /rf{655360 div mul Resolution mul 7227 div /PixPerEm X findfont
  769. dup length 1 add dict /nn X{1 index /FID ne{nn 3 1 roll put}{pop pop}ifelse}
  770. forall 256 dict begin nn /Encoding get 0 1 255{2 copy get 3 index 2 index get
  771. 1000 mul PixPerEm div def pop}for pop pop nn /Metrics currentdict put end
  772. /fontname X /nn dup nn definefont[PixPerEm 0 0 PixPerEm neg 0 0]makefont N
  773. fontname{/foo setfont}2 array copy cvx N fontname load 0 nn put}N
  774. /ObliqueSlant{dup sin S cos div neg}B /SlantFont{/foo X[1 0 foo 1 0 0]
  775. TransFont}N /ExtendFont{/foo X 3 2 roll[S{foo div}forall]3 1 roll[foo 0 0 1 0
  776. 0]TransFont}N /TransFont{S findfont S makefont dup length dict /nn X{1 index
  777. /FID ne{nn 3 1 roll put}{pop pop}ifelse}forall dup nn definefont pop}N end
  778. %%EndProcSet
  779. TeXDict begin 1000 300 300 @start /Fa [ 0 0 0 0 0 0 0 0 0 0
  780. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 25 25 25 25
  781. 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
  782. 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
  783. 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
  784. 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25
  785. 25 25 25 25 25 25 25 25 25 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  786. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 25 25 25 25 25 25
  787. 25 25 25 25 25 25 0 0 0 25 25 25 25 0 25 25 25 25 25 25 25
  788. 0 0 25 0 25 25 25 25 25 25 25 25 0 25 25 0 25 25 25 25 0 0
  789. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 0 0 0 0 25 25 0 25 0 0 0
  790. 0 0 0 0 0 0 25 0 0 25 25 0 25 0 0 0 0 ] /Courier-Bold 1000
  791. 655360 rf /Fb 1 26 df<07FFFE001FFFFF003FFFFF007FFFFE0070630000C0C3000080C70000
  792. 00C6000001C600000186000003860000038F0000038F0000070F0000070F00000F0F00000F0780
  793. 001E0780001E0780000C03000019147F931A>25 D E /Fc [ 0 0 0 0 0
  794. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 15
  795. 19 23 23 38 36 15 15 15 23 31 11 15 11 13 23 23 23 23 23 23
  796. 23 23 23 23 15 15 31 31 31 23 42 28 28 30 33 28 28 33 33 15
  797. 20 30 25 38 30 33 28 33 28 23 25 33 28 38 28 25 25 18 13 18
  798. 19 23 15 23 23 20 23 20 13 23 23 13 13 20 13 33 23 23 23 23
  799. 18 18 13 23 20 30 20 20 18 18 13 18 25 0 0 0 0 0 0 0 0 0 0
  800. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18 23 23 8
  801. 23 23 23 23 10 25 23 15 15 23 23 0 23 23 23 11 0 24 16 15 25
  802. 25 23 41 46 0 23 0 15 15 15 15 15 15 15 15 0 15 15 0 15 15
  803. 15 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 0 13 0 0 0 0 25 33
  804. 43 14 0 0 0 0 0 30 0 0 0 13 0 0 13 23 30 23 0 0 0 0 ] /Times-Italic
  805. 1000 720896 rf /Fd [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  806. 0 0 0 0 0 0 0 0 0 0 0 0 0 12 14 20 23 23 37 30 12 14 14 16
  807. 24 12 14 12 12 23 23 23 23 23 23 23 23 23 23 14 14 24 24 24
  808. 25 40 30 30 30 30 28 25 32 30 12 23 30 25 35 30 32 28 32 30
  809. 28 25 30 28 39 28 28 25 14 12 14 24 23 12 23 25 23 25 23 14
  810. 25 25 12 12 23 12 37 25 25 25 25 16 23 14 25 23 32 23 23 21
  811. 16 12 16 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  812. 0 0 0 0 0 0 0 0 0 0 14 23 23 7 23 23 23 23 10 21 23 14 14 25
  813. 25 0 23 23 23 12 0 23 15 12 21 21 23 42 42 0 25 0 14 14 14
  814. 14 14 14 14 14 0 14 14 0 14 14 14 42 0 0 0 0 0 0 0 0 0 0 0
  815. 0 0 0 0 0 42 0 15 0 0 0 0 25 32 42 15 0 0 0 0 0 37 0 0 0 12
  816. 0 0 12 25 39 25 0 0 0 0 ] /Helvetica-Bold 1000 655360 rf /Fe
  817. 2 122 df<0003FF0000000FFFC000003E01F00000F8007C0001E0001E00038000070007000003
  818. 800E000001C00C000000C01C000000E03800000070300000003030000000307000000038600000
  819. 00186000000018E00000001CC00000000CC00000000CC00000000CC00000000CC00000000CC000
  820. 00000CC00000000CC00000000CC00000000CE00000001C60000000186000000018700000003830
  821. 00000030300000003038000000701C000000E00C000000C00E000001C007000003800380000700
  822. 01E0001E0000F8007C00003E01F000000FFFC0000003FF0000262B7DA02D>13
  823. D<03000780078007800780078007800300030003007B78FFFCFFFC7B7803000300078007800780
  824. 078007800780078007800780078007800780078007800780078007800780078003000300030003
  825. 000300030003000E2A7D9F15>121 D E /Ff [ 0 0 0 0 0 0 0 0 0 0
  826. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 12 15 23 23
  827. 37 28 9 14 14 16 24 12 14 12 12 23 23 23 23 23 23 23 23 23
  828. 23 12 12 24 24 24 23 42 28 28 30 30 28 25 32 30 12 21 28 23
  829. 35 30 32 28 32 30 28 25 30 28 39 28 28 25 12 12 12 19 23 9
  830. 23 23 21 23 23 12 23 23 9 9 21 9 35 23 23 23 23 14 21 12 23
  831. 21 30 21 21 21 14 11 14 24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  832. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 23 23 7 23 23 23 23
  833. 8 14 23 14 14 21 21 0 23 23 23 12 0 22 15 9 14 14 23 42 42
  834. 0 25 0 14 14 14 14 14 14 14 14 0 14 14 0 14 14 14 42 0 0 0
  835. 0 0 0 0 0 0 0 0 0 0 0 0 0 42 0 15 0 0 0 0 23 32 42 15 0 0 0
  836. 0 0 37 0 0 0 12 0 0 9 25 39 25 0 0 0 0 ] /Helvetica 1000 655360
  837. rf /Fg [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  838. 0 0 0 0 0 0 0 14 17 24 28 28 44 36 14 17 17 19 29 14 17 14
  839. 14 28 28 28 28 28 28 28 28 28 28 17 17 29 29 29 30 49 36 36
  840. 36 36 33 30 39 36 14 28 36 30 41 36 39 33 39 36 33 30 36 33
  841. 47 33 33 30 17 14 17 29 28 14 28 30 28 30 28 17 30 30 14 14
  842. 28 14 44 30 30 30 30 19 28 17 30 28 39 28 28 25 19 14 19 29
  843. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  844. 0 0 0 0 17 28 28 8 28 28 28 28 12 25 28 17 17 30 30 0 28 28
  845. 28 14 0 28 17 14 25 25 28 50 50 0 30 0 17 17 17 17 17 17 17
  846. 17 0 17 17 0 17 17 17 50 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 50
  847. 0 18 0 0 0 0 30 39 50 18 0 0 0 0 0 44 0 0 0 14 0 0 14 30 47
  848. 30 0 0 0 0 ] /Helvetica-BoldOblique 1000 786432 rf /Fh [ 0
  849. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  850. 0 10 14 17 21 21 35 32 14 14 14 21 23 10 14 10 12 21 21 21
  851. 21 21 21 21 21 21 21 12 12 23 23 23 18 38 30 28 28 30 25 23
  852. 30 30 14 16 30 25 37 30 30 23 30 28 23 25 30 30 39 30 30 25
  853. 14 12 14 19 21 14 18 21 18 21 18 14 21 21 12 12 21 12 32 21
  854. 21 21 21 14 16 12 21 21 30 21 21 18 20 8 20 22 0 0 0 0 0 0
  855. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14
  856. 21 21 7 21 21 21 21 7 18 21 14 14 23 23 0 21 21 21 10 0 19
  857. 15 14 18 18 21 42 42 0 18 0 14 14 14 14 14 14 14 14 0 14 14
  858. 0 14 14 14 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 37 0 11 0 0 0
  859. 0 25 30 37 13 0 0 0 0 0 28 0 0 0 12 0 0 12 21 30 21 0 0 0 0
  860. ] /Times-Roman 1000 655360 rf /Fi [ 0 0 0 0 0 0 0 0 0 0 0 0
  861. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 27 27 27 27 27 27
  862. 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27
  863. 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27
  864. 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27
  865. 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27 27
  866. 27 27 27 27 27 27 27 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  867. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27 27 27 27 27 27 27 27 27
  868. 27 27 27 27 0 0 0 27 27 27 27 0 27 27 27 27 27 27 27 0 0 27
  869. 0 27 27 27 27 27 27 27 27 0 27 27 0 27 27 27 27 0 0 0 0 0 0
  870. 0 0 0 0 0 0 0 0 0 0 0 0 27 0 0 0 0 27 27 0 27 0 0 0 0 0 0 0
  871. 0 0 27 0 0 27 27 0 27 0 0 0 0 ] /Courier-Bold 1000 720896 rf
  872. /Fj [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  873. 0 0 0 0 0 11 15 19 23 23 38 36 15 15 15 23 26 11 15 11 13 23
  874. 23 23 23 23 23 23 23 23 23 13 13 26 26 26 20 42 33 30 30 33
  875. 28 25 33 33 15 18 33 28 41 33 33 25 33 30 25 28 33 33 43 33
  876. 33 28 15 13 15 21 23 15 20 23 20 23 20 15 23 23 13 13 23 13
  877. 36 23 23 23 23 15 18 13 23 23 33 23 23 20 22 9 22 25 0 0 0
  878. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  879. 0 15 23 23 8 23 23 23 23 8 20 23 15 15 25 25 0 23 23 23 11
  880. 0 21 16 15 20 20 23 46 46 0 20 0 15 15 15 15 15 15 15 15 0
  881. 15 15 0 15 15 15 46 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 41 0 13
  882. 0 0 0 0 28 33 41 14 0 0 0 0 0 30 0 0 0 13 0 0 13 23 33 23 0
  883. 0 0 0 ] /Times-Roman 1000 720896 rf /Fk [ 0 0 0 0 0 0 0 0 0
  884. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 15 22 25 25
  885. 41 33 13 15 15 18 27 13 15 13 13 25 25 25 25 25 25 25 25 25
  886. 25 15 15 27 27 27 28 45 33 33 33 33 30 28 36 33 13 25 33 28
  887. 38 33 36 30 36 33 30 28 33 30 43 30 30 28 15 13 15 27 25 13
  888. 25 28 25 28 25 15 28 28 13 13 25 13 41 28 28 28 28 18 25 15
  889. 28 25 36 25 25 23 18 13 18 27 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  890. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 15 25 25 8 25 25 25 25
  891. 11 23 25 15 15 28 28 0 25 25 25 13 0 25 16 13 23 23 25 46 46
  892. 0 28 0 15 15 15 15 15 15 15 15 0 15 15 0 15 15 15 46 0 0 0
  893. 0 0 0 0 0 0 0 0 0 0 0 0 0 46 0 17 0 0 0 0 28 36 46 17 0 0 0
  894. 0 0 41 0 0 0 13 0 0 13 28 43 28 0 0 0 0 ] /Helvetica-Bold 1000
  895. 720896 rf /Fl [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  896. 0 0 0 0 0 0 0 0 0 0 20 23 33 39 39 63 51 20 23 23 27 41 20
  897. 23 20 20 39 39 39 39 39 39 39 39 39 39 23 23 41 41 41 43 69
  898. 51 51 51 51 47 43 55 51 20 39 51 43 59 51 55 47 55 51 47 43
  899. 51 47 67 47 47 43 23 20 23 41 39 20 39 43 39 43 39 23 43 43
  900. 20 20 39 20 63 43 43 43 43 27 39 23 43 39 55 39 39 35 27 20
  901. 27 41 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
  902. 0 0 0 0 0 0 0 23 39 39 12 39 39 39 39 17 35 39 23 23 43 43
  903. 0 39 39 39 20 0 39 25 20 35 35 39 71 71 0 43 0 23 23 23 23
  904. 23 23 23 23 0 23 23 0 23 23 23 71 0 0 0 0 0 0 0 0 0 0 0 0 0
  905. 0 0 0 71 0 26 0 0 0 0 43 55 71 26 0 0 0 0 0 63 0 0 0 20 0 0
  906. 20 43 67 43 0 0 0 0 ] /Helvetica-BoldOblique 1000 1114112 rf
  907. end
  908. %%EndProlog
  909. %%BeginSetup
  910. %%Feature: *Resolution 300
  911. TeXDict begin @a4
  912. %%EndSetup
  913. %%Page: 0 1
  914. bop eop
  915. %%Page: 0 2
  916. bop 591 341 a Fl(Perl)20 b(Reference)h(Guide)p 591 362 1264 2 v 591 462 a Fk
  917. (for)12 b(Perl)h(version)g(4.019)591 645 y
  918. Fj(Perl)f(program)f(designed)f(and)i(created)g(by)591 701 y
  919. (Larry)f(W)l(all)h Fi(<)p Fj(lwall@netlabs.com)p Fi(>)591 884 y
  920. Fj(Reference)h(guide)e(designed)g(and)g(created)h(by)591 941 y
  921. (Johan)e(V)m(romans)i Fi(<)p Fj(jv@mh.nl)p Fi(>)591 1185 y
  922. Fl(Contents)p 591 1206 V 639 1306 a Fj(1.)21 b(Command)11 b(line)g
  923. (options)639 1363 y
  924. (2.)21 b(Literals)639 1419 y
  925. (3.)g(V)-5 b(ariables)639 1476 y
  926. (4.)21 b(Statements)639 1532 y
  927. (5.)g(Flow)12 b(control)639 1589 y
  928. (6.)21 b(Operators)639 1645 y
  929. (7.)g(File)12 b(test)f(operators)639 1701 y
  930. (8.)21 b(Arithmetic)11 b(functions)639 1758 y
  931. (9.)21 b(Conversion)11 b(functions)616 1814 y
  932. (10.)21 b(Structure)12 b(conversion)616 1871 y
  933. (11.)21 b(String)11 b(functions)616 1927 y
  934. (12.)21 b(Array)12 b(and)g(list)e(functions)616 1984 y
  935. (13.)21 b(File)12 b(operations)616 2040 y
  936. (14.)21 b(Directory)12 b(reading)f(routines)616 2097 y
  937. (15.)21 b(Input)11 b(/)g(Output)616 2153 y
  938. (16.)21 b(Search)13 b(and)e(replace)i(functions)616 2210 y
  939. (17.)21 b(System)11 b(interaction)616 2266 y
  940. (18.)21 b(Networking)616 2323 y
  941. (19.)g(SystemV)11 b(IPC)616 2379 y
  942. (20.)21 b(Miscellaneous)616 2435 y
  943. (21.)g(Formats)616 2492 y
  944. (22.)g(Info)12 b(from)f(system)f(\256les)616 2548 y
  945. (23.)21 b(Regular)12 b(expressions)616 2605 y
  946. (24.)21 b(Special)12 b(variables)616 2661 y
  947. (25.)21 b(Special)12 b(arrays)616 2718 y
  948. (26.)21 b(The)12 b(perl)f(debugger)591 2901 y
  949. Fh(Rev)m(.)f(4.019.1)p eop
  950. %%Page: 1 3
  951. bop 354 -101 a Fg(Perl)14 b(Reference)f(Guide)p 354 -89 1512 3 v 354 0 a Fl
  952. (Conventions)p 354 21 1512 2 v 354 121 a Fi(fixed)102 b Fj(denotes)10 b
  953. (literal)h(text.)354 186 y
  954. Ff(THIS)142 b Fj(means)11 b(variable)g(text,)g(i.e.)i(things)d(you)h(must)f
  955. (\256ll)h(in.)354 251 y
  956. Ff(THIS)p Fe(y)121 b Fj(means)11 b(that)g Ff(THIS)g Fj(will)f(default)h
  957. (to)g Fi($_)h Fj(if)g(omitted.)354 315 y
  958. Fd(word)139 b Fj(is)10 b(a)i(keyword,)g(i.e.)g(a)g(word)f(with)f(a)i(special)f
  959. (meaning.)p 354 337 112 2 v 354 393 2 56 v 368 380 a Ff
  960. (RET)p 464 393 V 354 395 112 2 v 140 w Fj(denotes)f(pressing)h(a)h(keyboard)f
  961. (key)m(.)354 445 y
  962. ([.)d(.)g(.)h(])149 b(denotes)10 b(an)i(optional)e(part.)354 510 y
  963. (\(.)e(.)g(.)h(\)*)126 b(means)11 b(that)g(the)g(parentheses)g(may)g(be)h
  964. (omitted.)355 635 y
  965. Fl(1.)19 b(Command)h(line)f(options)p 355 656 1512 2 v 354 757 a Fi(-a)64 b Fj
  966. (turns)11 b(on)g(autosplit)f(mode)h(when)g(used)g(with)g Fi(-n)h Fj(or)g Fi
  967. (-p)p Fj(.)g(Splits)f(to)g Fi(@F)p Fj(.)354 821 y
  968. Fi(-c)64 b Fj(checks)12 b(syntax)f(but)g(does)g(not)f(execute.)354 886 y
  969. Fi(-d)64 b Fj(runs)11 b(the)g(script)f(under)h(the)g(debugger)m(.)h(Use)f Fi
  970. (-de)28 b(0)12 b Fj(to)e(start)h(the)g(debugger)g(without)472 943 y
  971. (a)h(script.)354 1007 y
  972. Fi(-D)h Ff(NUMBER)472 1064 y
  973. Fj(sets)e(debugging)g(\257ags.)354 1129 y
  974. Fi(-e)i Ff(COMMANDLINE)472 1185 y
  975. Fj(may)e(be)h(used)f(to)g(enter)h(one)f(line)g(of)g(script.)h(Multiple)d Fi
  976. (-e)k Fj(commands)d(may)h(be)472 1241 y
  977. (given)g(to)g(build)g(up)g(a)g(multi-line)f(script.)354 1306 y
  978. Fi(-i)j Ff(EXT)472 1363 y
  979. Fj(\256les)f(processed)f(by)h(the)f Fi(<>)h Fj(construct)f(are)h(to)f(be)g
  980. (edited)g(in-place.)354 1427 y
  981. Fi(-I)i Ff(DIR)472 1484 y
  982. Fj(with)e Fi(-P)p Fj(:)h(tells)e(the)i(C)g(preprocessor)f(where)h(to)f(look)g
  983. (for)g(include)g(\256les.)h(The)472 1540 y
  984. (directory)g(is)f(prepended)g(to)g Fi(@INC)p Fj(.)354 1605 y
  985. Fi(-L)i Ff(OCTNUM)472 1662 y
  986. Fj(enables)f(automatic)e(line)h(ending)g(processing.)354 1726 y
  987. Fi(-n)64 b Fj(assumes)11 b(an)h(input)e(loop)g(around)i(your)f(script.)g
  988. (Lines)g(are)h(not)f(printed.)354 1791 y
  989. Fi(-p)64 b Fj(assumes)11 b(an)h(input)e(loop)g(around)i(your)f(script.)g
  990. (Lines)g(are)h(printed.)354 1856 y
  991. Fi(-P)64 b Fj(runs)11 b(the)h(C)g(preprocessor)f(on)g(the)h(script)e(before)i
  992. (compilation)e(by)h(perl.)354 1921 y
  993. Fi(-s)64 b Fj(interprets)11 b(\252)p Fi(-xxx)p Fj(\272)j(on)d(the)g(command)g
  994. (line)g(as)g(switches)g(and)g(sets)g(the)472 1977 y
  995. (corresponding)g(variables)g Fi($)q(xxx)h Fj(in)f(the)h(script.)354 2042 y
  996. Fi(-S)64 b Fj(uses)11 b(the)h Fi(PATH)h Fj(environment)d(variable)h(to)g
  997. (search)h(for)g(the)f(script.)354 2107 y
  998. Fi(-u)64 b Fj(dumps)11 b(core)h(after)g(compiling)d(the)j(script.)f(T)m(o)g
  999. (be)g(used)g(with)g(the)g Fc(undump)g Fj(program)472 2163 y
  1000. (\(where)i(available\).)354 2228 y
  1001. Fi(-U)64 b Fj(allows)11 b(perl)h(to)e(do)i(unsafe)f(operations.)354 2293 y
  1002. Fi(-v)64 b Fj(prints)11 b(the)g(version)g(and)g(patchlevel)g(of)h(your)f
  1003. (perl)g(executable.)354 2357 y
  1004. Fi(-w)64 b Fj(prints)11 b(warnings)g(about)g(possible)f(spelling)g(errors)i
  1005. (and)f(other)g(error)o(-prone)472 2414 y
  1006. (constructs)g(in)g(the)g(script.)354 2479 y
  1007. Fi(-x)64 b Fj(extracts)12 b(perl)f(program)g(from)h(input)e(stream.)354 2543 y
  1008. Fi(-0)j Ff(V)m(AL)472 2600 y
  1009. Fj(\(that')m(s)f(the)f(number)g(zero\))h(designates)f(an)h(initial)e(value)h
  1010. (for)g(the)h(record)g(terminator)472 2656 y
  1011. Fi($)q(/)p Fj(.)g(See)g(also)f Fi(-L)p Fj(.)p 354 3018 1512 3 v 354 3065 a Fg
  1012. (1)p eop
  1013. %%Page: 2 4
  1014. bop 1362 -101 a Fg(Perl)14 b(Reference)f(Guide)p 354 -89 1512 3 v 355 -2 a Fl
  1015. (2.)19 b(Literals)p 355 19 1512 2 v 354 119 a Fj(Numeric:)11 b Fi(123)56 b
  1016. (123.4)h(5E-10)g(0xff)13 b Fj(\(hex\))55 b Fi(0377)13 b Fj(\(octal\).)354 184 y
  1017. (String:)e Fi('abc')i Fj(literal)e(string,)g(no)g(variable)h(interpolation)e
  1018. (nor)h(escape)h(characters.)591 241 y
  1019. (Also:)e Fi(q/abc/)p Fj(.)591 297 y
  1020. (\(Almost)g(any)h(pair)g(of)h(delimiters)e(can)i(be)f(used)g(instead)g(of)h Fi
  1021. (/.../)p Fj(.\))472 362 y
  1022. Fi("abc")i Fj(V)-5 b(ariables)11 b(are)h(interpolated)f(and)g(escape)h
  1023. (sequences)g(are)g(processed.)591 418 y
  1024. (Also:)e Fi(qq/abc/)p Fj(.)591 475 y
  1025. (Escape)h(sequences:)h Fi(\\t)g Fj(\(T)m(ab\),)g Fi(\\n)g Fj(\(Newline\),)g Fi
  1026. (\\r)g Fj(\(Return\),)h Fi(\\f)591 531 y
  1027. Fj(\(Formfeed\),)f Fi(\\b)h Fj(\(Backspace\),)g Fi(\\a)f Fj(\(Alarm\),)g Fi
  1028. (\\e)g Fj(\(Escape\),)h Fi(\\033)p Fj(\(octal\),)591 588 y
  1029. Fi(\\x1b)p Fj(\(hex\),)g Fi(\\c[)g Fj(\(control\).)591 644 y
  1030. Fi(\\l)f Fj(and)f Fi(\\u)h Fj(lowcase/upcase)g(the)f(following)f
  1031. (character;)591 701 y
  1032. Fi(\\L)i Fj(and)f Fi(\\U)h Fj(lowcase/upcase)g(until)e(a)i Fi(\\E)g Fj(is)f
  1033. (encountered.)472 765 y
  1034. Fi(`)p Ff(COMMAND)p Fi(`)h Fj(evaluates)f(to)g(the)g(output)f(of)i(the)f Ff
  1035. (COMMAND)p Fj(.)591 822 y
  1036. (Also:)f Fi(qx/)p Ff(COMMAND)p Fi(/)p Fj(.)354 887 y
  1037. (Array:)i Fi(\(1,2,3\))p Fj(.)j Fi(\(\))d Fj(is)f(an)g(empty)g(array)m
  1038. (.)472 943 y
  1039. (Also:)g Fi(\($a,$b,@re)q(st)q(\))30 b(=)e(\(1,2,...\))q(;)472 999 y
  1040. (\(1..4\))14 b Fj(is)d(the)g(same)h(as)f Fi(\(1,2,3,4\))q Fj(.)j(Likewise)d Fi
  1041. (\('abc'..')q(ad)q(e'\))354 1064 y
  1042. Fj(Associative)g(array:)h Fi(\()p Ff(KEY1)p Fi(,)p Ff(V)m(AL1)p Fi(,)p Ff
  1043. (KEY2)p Fi(,)p Ff(V)m(AL2)p Fi(,...\))354 1129 y
  1044. Fj(Filehandles:)472 1185 y
  1045. (Pre-de\256ned:)h Fi(<STDIN>)p Fj(,)i Fi(<STDOUT>)p Fj(,)g Fi(<STDERR>)p Fj
  1046. (,)g Fi(<ARGV>)p Fj(,)f Fi(<DATA>)p Fj(;)472 1242 y
  1047. (User)o(-speci\256ed:)e Fi(<)p Ff(HANDLE)p Fi(>)p Fj(,)g Fi(<$)p Ff(V)m
  1048. (AR)p Fi(>)p Fj(.)472 1298 y
  1049. Fi(<>)h Fj(is)e(the)g(input)f(stream)h(formed)g(by)h(the)f(\256les)g
  1050. (speci\256ed)h(in)f Fi(@ARGV)p Fj(,)j(or)d(standard)472 1355 y
  1051. (input)g(if)g(no)g(ar)o(guments)g(are)h(supplied.)354 1420 y
  1052. (Globs:)f Fi(<)p Ff(P)m(A)m(TTERN)p Fi(>)g Fj(evaluates)h(to)f(all)g
  1053. (\256lenames)g(according)h(to)f(the)g(pattern.)472 1476 y
  1054. (Use)h Fi(<${)p Ff(V)m(AR)p Fi(}>)h Fj(to)d(glob)h(from)g(a)h
  1055. (variable.)354 1541 y
  1056. (Here-Is:)g Fi(<<)p Ff(IDENTIFIER)472 1597 y
  1057. Fc(See)g(the)f(manual)g(for)g(details.)354 1662 y
  1058. Fj(Special)h(tokens:)472 1718 y
  1059. Fi(_)c(_)q(FILE_)h(_)q Fj(:)i(\256lename;)g Fi(_)d(_)q(LINE_)h(_)q Fj(:)i
  1060. (line)g(number)m(.)472 1775 y
  1061. Fi(_)d(_)q(END_)h(_)p Fj(:)j(end)f(of)g(program;)g(remaining)g(lines)f(can)i
  1062. (be)g(read)g(using)e Fi(<)p Ff(DA)m(T)m(A)p Fi(>)p Fj(.)355 1904 y
  1063. Fl(3.)19 b(V)m(ariables)p 355 1925 V 354 2026 a Fi($)q(var)269 b Fj(a)12 b
  1064. (simple)e(scalar)i(variable)354 2090 y
  1065. Fi($)q(var[28])161 b Fj(29th)11 b(element)g(of)g(array)i Fi(@var)g Fj
  1066. (\(the)e Fi([])h Fj(are)g(part)g(of)f(it\))354 2155 y
  1067. Fi($)q(var{)q('Feb'})79 b Fj(one)12 b(value)f(from)g(associative)g(array)h Fi
  1068. (\045var)354 2220 y
  1069. ($)q(#var)242 b Fj(last)11 b(index)g(of)g(array)i Fi(@var)354 2285 y
  1070. (@var)270 b Fj(the)11 b(entire)h(array;)732 2341 y
  1071. (in)f(scalar)h(context:)f(the)g(number)g(of)g(elements)g(in)g(the)g
  1072. (array)354 2406 y
  1073. Fi(@var[3,4)q(,5])80 b Fj(a)12 b(slice)f(of)h(the)f(array)h Fi(@var)354 2471 y
  1074. (@var{)r('a','b'})25 b Fj(a)12 b(slice)f(of)h Fi(\045var)p Fj(;)g(same)f
  1075. (as)h Fi(\($var{'a')q(},$)q(va)q(r{')q(b'})q(\))354 2535 y
  1076. (\045)q(var)269 b Fj(the)11 b(entire)h(associative)f(array;)732 2592 y
  1077. (in)g(scalar)h(context:)f(TRUE)g(if)h(the)f(array)h(has)f(elements)354 2657 y
  1078. Fi($)q(var{)q('a',1,...)q(})24 b Fj(emulates)11 b(a)g(multi-dimensional)e
  1079. (array)354 2721 y
  1080. Fi(\('a'..'z)q('\)[)q(4,7)q(,9)q(])732 2778 y
  1081. Fj(a)j(slice)f(of)h(an)f(array)h(literal)354 2843 y
  1082. Fi(*)p Ff(NAME)230 b Fj(refers)13 b(to)e(all)g(objects)f(represented)i(by)f Ff
  1083. (NAME)p Fj(.)g(\252)p Fi(*name1)30 b(=)732 2899 y
  1084. (*name2)p Fj(\272)14 b(makes)d Fi(name1)j Fj(a)e(reference)h(to)e Fi
  1085. (name2)p Fj(.)p 354 3018 1512 3 v 1838 3065 a Fg(2)p eop
  1086. %%Page: 3 5
  1087. bop 354 -101 a Fg(Perl)14 b(Reference)f(Guide)p 354 -89 1512 3 v 355 -2 a Fl
  1088. (4.)19 b(Statements)p 355 19 1512 2 v 354 119 a Fj(Every)12 b(statement)e(is)h
  1089. (an)h(expression,)f(optionally)e(followed)i(by)g(a)h(modi\256er)n(,)g
  1090. (and)354 176 y
  1091. (terminated)f(by)g(a)h(semi-colon.)354 241 y
  1092. (Execution)f(of)g(expressions)g(can)h(depend)f(on)g(other)g(expressions)g
  1093. (using)f(one)h(of)h(the)354 297 y
  1094. (modi\256ers)f Fd(if)p Fj(,)g Fd(unless)p Fj(,)i Fd(while)e Fj(or)g Fd
  1095. (until)p Fj(,)h(e.g.:)400 362 y
  1096. Ff(EXPR1)f Fd(if)f Ff(EXPR2)h Fi(;)400 418 y
  1097. Ff(EXPR1)g Fd(until)g Ff(EXPR2)f Fi(;)354 483 y
  1098. Fj(Also,)h(by)g(using)g(one)g(of)h(the)f(logical)g(operators)g Fi(||)q Fj
  1099. (,)h Fi(&&)g Fj(or)f Fi(?)28 b(:)p Fj(,)12 b(e.g.:)400 548 y
  1100. Ff(EXPR1)f Fi(||)h Ff(EXPR2)e Fi(;)400 604 y
  1101. Ff(EXPR1)h Fi(?)g Ff(EXPR2)g Fi(:)h Ff(EXPR3)e Fi(;)354 669 y
  1102. Fj(Statements)h(can)h(be)f(combined)g(to)g(form)g(a)h Ff(BLOCK)f Fj(when)g
  1103. (enclosed)g(in)g Fi({})p Fj(.)354 734 y
  1104. (Compound)g(statements)f(may)h(be)g(used)h(to)f(control)f(\257ow:)400 799 y
  1105. Fd(if)h Fi(\()p Ff(EXPR)p Fi(\))g Ff(BLOCK)g Fj([)h([)f Fd(elsif)g Fi(\()p Ff
  1106. (EXPR)p Fi(\))g Ff(BLOCK)g(...)f Fj(])i Fd(else)f Ff(BLOCK)g Fj(])400 855 y
  1107. Fd(unless)h Fi(\()p Ff(EXPR)p Fi(\))f Ff(BLOCK)g Fj([)h Fd(else)f Ff(BLOCK)g Fj
  1108. (])400 911 y
  1109. ([)h Ff(LABEL)p Fd(:)e Fj(])i Fd(while)f Fi(\()p Ff(EXPR)p Fi(\))g Ff
  1110. (BLOCK)g Fj([)h Fd(continue)g Ff(BLOCK)f Fj(])400 968 y
  1111. ([)h Ff(LABEL)p Fd(:)e Fj(])i Fd(until)f Fi(\()p Ff(EXPR)p Fi(\))g Ff
  1112. (BLOCK)g Fj([)h Fd(continue)g Ff(BLOCK)f Fj(])400 1024 y
  1113. ([)h Ff(LABEL)p Fd(:)e Fj(])i Fd(for)f Fi(\()p Ff(EXPR)p Fi(;)h Ff(EXPR)p Fi
  1114. (;)f Ff(EXPR)p Fi(\))f Ff(BLOCK)400 1081 y
  1115. Fj([)i Ff(LABEL)p Fd(:)e Fj(])i Fd(foreach)g Ff(V)m(AR)p Fe(y)o Fi(\()p Ff
  1116. (ARRA)m(Y)p Fi(\))f Ff(BLOCK)400 1137 y
  1117. Fj([)h Ff(LABEL)p Fd(:)e Fj(])i Ff(BLOCK)f Fj([)g Fd(continue)24 b Ff
  1118. (BLOCK)12 b Fj(])354 1202 y
  1119. (Special)g(forms)f(are:)400 1267 y
  1120. Fd(do)h Ff(BLOCK)f Fd(while)h Ff(EXPR)e Fi(;)400 1323 y
  1121. Fd(do)i Ff(BLOCK)f Fd(until)g Ff(EXPR)g Fi(;)354 1380 y
  1122. Fj(which)g(are)i(guaranteed)e(to)g(perform)h Ff(BLOCK)f Fj(once)g(before)h
  1123. (testing)f Ff(EXPR)p Fj(.)355 1503 y
  1124. Fl(5.)19 b(Flow)h(control)p 355 1524 V 354 1624 a Fd(do)12 b Ff
  1125. (BLOCK)472 1681 y
  1126. Fj(Returns)g(the)f(value)g(of)h(the)f(last)g(command)f(in)h(the)h(sequence)f
  1127. (of)h(commands)472 1737 y
  1128. (indicated)f(by)g Ff(BLOCK)p Fj(.)h Fd(next)p Fj(,)g Fd(last)f Fj(and)g Fd
  1129. (redo)i Fj(cannot)e(be)g(used)h(here.)354 1802 y
  1130. Fd(do)g Ff(SUBROUTINE)p Fd(\(LIST\))472 1859 y
  1131. Fj(Executes)g(a)f Ff(SUBROUTINE)g Fj(declared)h(by)f(a)h Fd(sub)g Fj
  1132. (declaration,)g(and)f(returns)g(the)472 1915 y
  1133. (value)h(of)f(the)g(last)g(expression)g(evaluated)g(in)g Ff(SUBROUTINE)g Fj
  1134. (.)472 1971 y
  1135. (Preferred)j(form)d(is:)f Fi(&)p Ff(SUBROUTINE)h Fj(.)354 2036 y
  1136. Fd(do)h Ff(FILENAME)472 2093 y
  1137. Fj(Executes)g(the)f(contents)g(of)g Ff(FILENAME)f Fj(as)h(a)h(perl)g(script.)f
  1138. (Errors)g(are)i(returned)e(in)472 2149 y
  1139. Fi($@)p Fj(.)472 2206 y
  1140. (Preferred)j(form)d(is:)f Fd(require)j Ff(FILENAME)d Fj(.)354 2270 y
  1141. Fd(goto)j Ff(LABEL)472 2327 y
  1142. Fj(Continue)e(execution)g(at)h(the)f(speci\256ed)h(label.)354 2392 y
  1143. Fd(last)f Fj([)p Ff(LABEL)p Fj(])472 2448 y
  1144. (Immediately)g(exits)f(the)i(loop)e(in)h(question.)g(Skips)g(continue)f
  1145. (block.)354 2513 y
  1146. Fd(next)i Fj([)p Ff(LABEL)p Fj(])472 2569 y
  1147. (Starts)g(the)f(next)g(iteration)g(of)g(the)g(loop.)354 2634 y
  1148. Fd(redo)i Fj([)p Ff(LABEL)p Fj(])472 2690 y
  1149. (Restarts)f(the)f(loop)g(block)g(without)f(evaluating)g(the)h(conditional)f
  1150. (again.)354 2755 y
  1151. Fd(return)j Ff(EXPR)472 2812 y
  1152. Fj(Returns)f(from)f(a)h(subroutine)e(with)h(the)g(value)g
  1153. (speci\256ed.)p 354 3018 1512 3 v 354 3065 a Fg(3)p eop
  1154. %%Page: 4 6
  1155. bop 1362 -101 a Fg(Perl)14 b(Reference)f(Guide)p 354 -89 1512 3 v 355 -2 a Fl
  1156. (6.)19 b(Operators)p 355 19 1512 2 v 354 119 a Fi(+)28 b(-)g(*)g(/)g Fj
  1157. (Addition,)10 b(subtraction,)g(multiplication,)g(division.)354 176 y
  1158. Fi(\045)193 b Fj(Modulo)10 b(division.)354 232 y
  1159. Fi(|)i(&)44 b(\303)83 b Fj(Bitwise)10 b(or)n(,)j(bitwise)d(and,)i(bitwise)e
  1160. (exclusive)h(or)m(.)354 289 y
  1161. Fi(>>)56 b(<<)g Fj(Bitwise)10 b(shift)h(right,)g(bitwise)f(shift)h
  1162. (left.)354 345 y
  1163. Fi(**)166 b Fj(Exponentiation.)354 402 y
  1164. Fi(.)193 b Fj(Concatenation)11 b(of)g(two)g(strings.)354 458 y
  1165. Fd(x)197 b Fj(Returns)11 b(a)h(string)e(or)i(array)g(consisting)d(of)j(the)f
  1166. (left)g(operand)h(\(an)g(array)g(or)574 515 y
  1167. (a)f(string\))g(repeated)h(the)f(number)g(of)g(times)g(speci\256ed)h(by)f
  1168. (the)g(right)g(operand.)354 579 y
  1169. (All)g(of)h(the)f(above)g(operators)h(also)f(have)g(an)h(assignment)e
  1170. (operator)n(,)i(e.g.)g(\252)p Fi(.=)p Fj(\272.)354 644 y
  1171. Fi(++)56 b(--)g Fj(Auto-increment)10 b(\(magical)h(on)g(strings\),)g
  1172. (auto-decrement.)354 701 y
  1173. Fi(?)28 b(:)138 b Fj(Alternation)10 b(\(if-then-else\))i(operator)m(.)354 757 y
  1174. Fi(|)q(|)55 b(&&)h Fj(Logical)10 b(or)n(,)i(logical)f(and.)354 813 y
  1175. Fi(=)d(=)48 b(!=)56 b Fj(Numeric)11 b(equality)m(,)g(inequality)m(.)354 870 y
  1176. Fd(eq)62 b(ne)g Fj(String)11 b(equality)m(,)g(inequality)m(.)354 926 y
  1177. Fi(<)83 b(>)g Fj(Numeric)11 b(less)g(than,)g(greater)h(than.)354 983 y
  1178. Fd(lt)84 b(gt)71 b Fj(String)11 b(less)f(than,)i(greater)g(than.)354 1039 y
  1179. Fi(<=)56 b(>=)g Fj(Numeric)11 b(less)g(\(greater\))h(than)f(or)h(equal)f
  1180. (to.)354 1096 y
  1181. Fd(le)75 b(ge)62 b Fj(String)11 b(less)f(\(greater\))j(than)e(or)h
  1182. (equal.)354 1152 y
  1183. Fi(<=>)139 b Fj(Numeric)11 b(compare.)h(Returns)f(-1,)h(0)f(or)h(1.)354 1209 y
  1184. Fd(cmp)135 b Fj(String)11 b(compare.)h(Returns)f(-1,)h(0)f(or)h(1.)354 1265 y
  1185. Fi(=\304)56 b(!\304)g Fj(Search)12 b(pattern,)g(substitution,)d(or)i
  1186. (translation)f(\(negated\).)354 1322 y
  1187. Fi(..)166 b Fj(Enumeration,)10 b(also)h(input)g(line)f(range)i(operator)m
  1188. (.)354 1378 y
  1189. Fi(,)193 b Fj(Comma)11 b(operator)m(.)355 1508 y
  1190. Fl(7.)19 b(File)g(test)j(operators)p 355 1529 V 354 1630 a Fj(These)12 b
  1191. (unary)f(operators)g(takes)h(one)f(ar)o(gument,)h(either)f(a)h(\256lename)f
  1192. (or)h(a)f(\256lehandle,)h(and)354 1686 y
  1193. (tests)f(the)g(associated)g(\256le)h(to)f(see)h(if)f(something)f(is)h(true)g
  1194. (about)g(it.)g(If)h(the)f(ar)o(gument)g(is)354 1743 y
  1195. (omitted,)g(tests)f Fi($_)j Fj(\(except)e(for)h Fi(-t,)h Fj(which)e(tests)f Fi
  1196. (STDIN)p Fj(\).)k(If)e(the)f(special)g(ar)o(gument)h Fi(_)354 1799 y
  1197. Fj(\(underscore\))g(is)f(passed,)h(uses)f(the)g(info)g(of)h(the)f(preceding)g
  1198. (test.)354 1864 y
  1199. Fi(-r)29 b(-w)f(-x)g(-o)650 1920 y
  1200. Fj(File)11 b(is)g(readable/writable/executable/owned)g(by)g(ef)o(fective)h
  1201. (uid.)354 1985 y
  1202. Fi(-R)29 b(-W)f(-X)g(-O)650 2042 y
  1203. Fj(File)11 b(is)g(readable/writable/executable/owned)g(by)g(real)h
  1204. (uid.)354 2106 y
  1205. Fi(-e)29 b(-z)f(-s)77 b Fj(File)11 b(exists)g(/)g(has)g(zero/non-zero)h
  1206. (size.)354 2171 y
  1207. Fi(-f)29 b(-d)159 b Fj(File)11 b(is)g(a)h(plain)e(\256le,)j(a)e(directory)m
  1208. (.)354 2236 y
  1209. Fi(-l)29 b(-S)f(-p)77 b Fj(File)11 b(is)g(a)h(symbolic)d(link,)i(a)h(socket,)g
  1210. (a)f(named)g(pipe)g(\(FIFO\).)354 2301 y
  1211. Fi(-b)29 b(-c)159 b Fj(File)11 b(is)g(a)h(block/character)g(special)f
  1212. (\256le.)354 2365 y
  1213. Fi(-u)29 b(-g)f(-k)77 b Fj(File)11 b(has)g(setuid/setgid/sticky)d(bit)j
  1214. (set.)354 2430 y
  1215. Fi(-t)242 b Fj(T)m(ests)10 b(if)i(\256lehandle)f(\()p Fi(STDIN)j Fj(by)d
  1216. (default\))g(is)g(opened)g(to)g(a)h(tty)m(.)354 2495 y
  1217. Fi(-T)29 b(-B)159 b Fj(File)11 b(is)g(a)h(text/non-text)d(\(binary\))j
  1218. (\256le.)g Fi(-T)g Fj(and)g Fi(-B)g Fj(return)f(TRUE)h(on)f(a)650 2551 y
  1219. (null)f(\256le,)i(or)g(a)f(\256le)h(at)g(EOF)f(when)h(testing)e(a)h
  1220. (\256lehandle.)354 2616 y
  1221. Fi(-M)29 b(-A)f(-C)77 b Fj(File)11 b(creation)h(/)f(access)h(/)f(inode)g
  1222. (change)g(time.)g(Measured)h(in)f(days)g(since)650 2673 y
  1223. (this)f(program)h(started.)h(See)g(also)f Fi($\303T)i Fj(in)e(section)f
  1224. (\252Special)i(V)-5 b(ariables\272.)p 354 3018 1512 3 v 1838 3065 a Fg(4)p eop
  1225. %%Page: 5 7
  1226. bop 354 -101 a Fg(Perl)14 b(Reference)f(Guide)p 354 -89 1512 3 v 354 -12 a Fj
  1227. (A)f Ff(LIST)f Fj(is)g(a)g(\(possibly)f(parenthesised\))h(list)g(of)g
  1228. (expressions,)g(variables)g(or)h Ff(LIST)p Fj(s.)f(An)354 45 y
  1229. (array)i(variable)e(or)g(an)h(array)g(slice)f(may)g(always)h(be)f(used)g
  1230. (instead)g(of)g(a)h Ff(LIST)p Fj(.)355 168 y
  1231. Fl(8.)19 b(Arithmetic)i(functions)p 355 189 1512 2 v 354 290 a Fd(atan2\()p Ff
  1232. (Y)p Fd(,)p Ff(X)p Fd(\))472 346 y
  1233. Fj(Returns)12 b(the)f(arctangent)h(of)f Ff(Y)p Fj(/)p Ff(X)g Fj(in)g(the)g
  1234. (range)h(-)p Fb(\031)h Fj(to)e Fb(\031)r Fj(.)354 411 y
  1235. Fd(cos\()p Ff(EXPR)p Fe(y)o Fd(\))p Fj(*)472 467 y
  1236. (Returns)h(the)f(cosine)g(of)h Ff(EXPR)e Fj(\(expressed)i(in)f
  1237. (radians\).)354 532 y
  1238. Fd(exp\()p Ff(EXPR)p Fe(y)o Fd(\))p Fj(*)472 588 y
  1239. (Returns)h Fi(e)g Fj(to)f(the)g(power)g(of)h Ff(EXPR)p Fj(.)354 653 y
  1240. Fd(int\()p Ff(EXPR)p Fe(y)n Fd(\))p Fj(*)472 710 y
  1241. (Returns)g(the)f(integer)g(portion)g(of)g Ff(EXPR)p Fj(.)354 774 y
  1242. Fd(log\()p Ff(EXPR)p Fe(y)o Fd(\))p Fj(*)472 831 y
  1243. (Returns)h(natural)f(logarithm)f(\(base)i Fi(e)p Fj(\))g(of)f Ff(EXPR)p Fj
  1244. (.)354 896 y
  1245. Fd(rand)p Fj([)p Fd(\()p Ff(EXPR)p Fd(\))p Fj(*])472 952 y
  1246. (Returns)h(a)g(random)f(fractional)g(number)g(between)g(0)h(and)f(the)g
  1247. (value)h(of)f Ff(EXPR)p Fj(.)g(If)472 1008 y
  1248. Ff(EXPR)g Fj(is)g(omitted,)f(returns)h(a)h(value)f(between)h(0)f(and)h
  1249. (1.)354 1073 y
  1250. Fd(sin\()p Ff(EXPR)p Fe(y)n Fd(\))p Fj(*)472 1130 y
  1251. (Returns)g(the)f(sine)g(of)h Ff(EXPR)e Fj(\(expressed)i(in)f
  1252. (radians\).)354 1194 y
  1253. Fd(sqrt\()p Ff(EXPR)p Fe(y)o Fd(\))p Fj(*)472 1251 y
  1254. (Return)h(the)f(square)h(root)f(of)g Ff(EXPR)p Fj(.)354 1316 y
  1255. Fd(srand)p Fj([)p Fd(\()p Ff(EXPR)p Fd(\))p Fj(*])472 1372 y
  1256. (Sets)h(the)f(random)g(number)g(seed)h(for)f(the)g(rand)h(operator)m
  1257. (.)354 1437 y
  1258. Fd(time)32 b Fj(Returns)12 b(the)f(number)g(of)g(seconds)g(since)h(January)f
  1259. (1,)h(1970.)f(Suitable)g(for)h(feeding)472 1493 y
  1260. (to)f Fd(gmtime)g Fj(and)h Fd(localtime)p Fj(.)355 1618 y
  1261. Fl(9.)19 b(Conversion)i(functions)p 355 1639 V 354 1740 a Fd(gmtime\()p Ff
  1262. (EXPR)p Fd(\))p Fj(*)472 1796 y
  1263. (Converts)12 b(a)f(time)g(as)g(returned)h(by)f(the)g Fd(time)g Fj(function)g
  1264. (to)g(a)g(9-element)g(array)i(\()p Fi($)p Fj(sec,)472 1852 y
  1265. Fi($)q Fj(min,)e Fi($)p Fj(hour)n(,)h Fi($)p Fj(mday)m(,)g Fi($)p Fj(mon,)f Fi
  1266. ($)p Fj(year)n(,)i Fi($)p Fj(wday)m(,)f Fi($)q Fj(yday)m(,)f Fi($)q Fj
  1267. (isdst\))f(with)g(the)i(time)472 1909 y
  1268. (analyzed)g(for)g(the)f(Greenwich)h(timezone.)f Fi($)p Fj(mon)g(has)g(the)g
  1269. (range)h(0..11)g(and)f Fi($)q Fj(wday)472 1965 y
  1270. (has)h(the)f(range)h(0..6.)354 2030 y
  1271. Fd(hex\()p Ff(EXPR)p Fe(y)o Fd(\))p Fj(*)472 2087 y
  1272. (Returns)g(the)f(decimal)g(value)g(of)h Ff(EXPR)e Fj(interpreted)i(as)f(an)h
  1273. (hex)f(string.)354 2151 y
  1274. Fd(localtime\()p Ff(EXPR)p Fd(\))p Fj(*)472 2208 y
  1275. (Converts)h(a)f(time)g(as)g(returned)h(by)f(the)g Fd(time)g Fj(function)g(to)g
  1276. (a)g(9-element)g(array)i(with)472 2264 y
  1277. (the)f(time)e(analyzed)i(for)g(the)f(local)g(timezone.)354 2329 y
  1278. Fd(oct\()p Ff(EXPR)p Fe(y)o Fd(\))p Fj(*)472 2385 y
  1279. (Returns)h(the)f(decimal)g(value)g(of)h Ff(EXPR)e Fj(interpreted)i(as)f(an)h
  1280. (octal)f(string.)g(If)g Ff(EXPR)472 2442 y
  1281. Fj(starts)g(of)o(f)h(with)f Fi(0x)p Fj(,)h(interprets)f(it)g(as)g(a)h(hex)f
  1282. (string)g(instead.)354 2507 y
  1283. Fd(ord\()p Ff(EXPR)p Fe(y)o Fd(\))p Fj(*)472 2563 y
  1284. (Returns)h(the)f(ascii)g(value)h(of)f(the)g(\256rst)h(character)g(of)g Ff
  1285. (EXPR)p Fj(.)354 2628 y
  1286. Fd(vec\()p Ff(EXPR)p Fd(,)p Ff(OFFSET)p Fd(,)p Ff(BITS)p Fd(\))472 2684 y
  1287. Fj(T)n(reats)g Ff(EXPR)f Fj(as)g(a)h(string)e(of)i(unsigned)e(ints,)h(and)g
  1288. (yields)g(the)g(bit)g(at)g Ff(OFFSET)p Fj(.)472 2741 y
  1289. Ff(BITS)g Fj(must)f(be)i(between)f(1)h(and)f(32.)h(May)f(be)g(used)g(as)h(an)f
  1290. (lvalue.)p 354 3018 1512 3 v 354 3065 a Fg(5)p eop
  1291. %%Page: 6 8
  1292. bop 1362 -101 a Fg(Perl)14 b(Reference)f(Guide)p 354 -89 1512 3 v 355 -2 a Fl
  1293. (10.)19 b(Structure)k(conversion)p 355 19 1512 2 v 354 119 a Fd(pack\()p Ff
  1294. (TEMPLA)m(TE)p Fd(,)p Ff(LIST)p Fd(\))472 176 y
  1295. Fj(Packs)12 b(the)g(values)f(into)f(a)i(binary)f(structure)g(using)f Ff
  1296. (TEMPLA)m(TE)p Fj(.)354 241 y
  1297. Fd(unpack\()p Ff(TEMPLA)m(TE)p Fd(,)p Ff(EXPR)p Fd(\))472 297 y
  1298. Fj(Unpacks)i(the)f(structure)g Ff(EXPR)f Fj(into)h(an)g(array)m(,)i(using)d Ff
  1299. (TEMPLA)m(TE)p Fj(.)472 362 y
  1300. Ff(TEMPLA)m(TE)h Fj(is)g(a)g(sequence)h(of)g(characters)g(as)g
  1301. (follows:)527 427 y
  1302. Fi(a)28 b Fj(/)42 b Fi(A)55 b Fj(Ascii)11 b(string,)g(null)f(/)h(space)h
  1303. (padded)527 483 y
  1304. Fi(b)28 b Fj(/)42 b Fi(B)55 b Fj(Bit)11 b(string)g(in)g(ascending)g(/)g
  1305. (descending)g(order)527 540 y
  1306. Fi(c)28 b Fj(/)42 b Fi(C)55 b Fj(Native)11 b(/)g(unsigned)g(char)h
  1307. (value)527 596 y
  1308. Fi(f)28 b Fj(/)42 b Fi(d)55 b Fj(Single)11 b(/)g(double)g(\257oat)h(in)f
  1309. (native)g(format)527 652 y
  1310. Fi(h)28 b Fj(/)42 b Fi(H)55 b Fj(Hex)12 b(string,)e(low)h(/)g(high)g(nybble)g
  1311. (\256rst.)527 709 y
  1312. Fi(i)28 b Fj(/)42 b Fi(I)55 b Fj(Signed)11 b(/)g(unsigned)g(integer)g
  1313. (value)527 765 y
  1314. Fi(l)28 b Fj(/)42 b Fi(L)55 b Fj(Signed)11 b(/)g(unsigned)g(long)f
  1315. (value)527 822 y
  1316. Fi(n)28 b Fj(/)42 b Fi(N)55 b Fj(Short)11 b(/)g(long)g(in)g(network)g(byte)g
  1317. (order)527 878 y
  1318. Fi(s)28 b Fj(/)42 b Fi(S)55 b Fj(Signed)11 b(/)g(unsigned)g(short)f
  1319. (value)527 935 y
  1320. Fi(u)28 b Fj(/)42 b Fi(p)55 b Fj(Uuencoded)11 b(string)g(/)g(Pointer)g(to)g
  1321. (a)h(string)527 991 y
  1322. Fi(x)28 b Fj(/)42 b Fi(@)55 b Fj(Null)11 b(byte)g(/)g(null)f(\256ll)h(until)g
  1323. (position)527 1048 y
  1324. Fi(X)165 b Fj(Backup)12 b(a)g(byte)472 1112 y
  1325. (Each)g(character)h(may)e(be)g(followed)g(by)g(a)h(decimal)f(number)g(which)g
  1326. (will)f(be)i(used)f(as)472 1169 y
  1327. (a)h(repeat)g(count,)f(an)h Fi(*)g Fj(speci\256es)f(all)g(remaining)g(ar)o
  1328. (guments.)472 1225 y
  1329. (If)h(the)f(format)h(is)f(preceded)h(with)e Fi(\045)p Ff(N)p Fj(,)j Fd
  1330. (unpack)f Fj(returns)f(an)h Ff(N)p Fj(-bit)f(checksum)472 1282 y
  1331. (instead.)472 1338 y
  1332. (Spaces)i(may)e(be)g(included)g(in)g(the)g(template)g(for)g(readability)g
  1333. (purposes.)355 1461 y
  1334. Fl(11.)19 b(String)i(functions)p 355 1482 V 354 1583 a Fd(chop\()p Ff(LIST)p Fe
  1335. (y)p Fd(\))472 1639 y
  1336. Fj(Chops)12 b(of)o(f)f(the)h(last)e(character)j(on)e(all)g(elements)g(of)h
  1337. (the)f(list;)f(returns)h(the)g(last)472 1696 y
  1338. (chopped)h(character)m(.)h(The)f(parentheses)f(may)g(be)h(omitted)e(if)h Ff
  1339. (LIST)g Fj(is)g(a)h(single)472 1752 y
  1340. (variable.)354 1817 y
  1341. Fd(crypt\()p Ff(PLAINTEXT)p Fd(,)p Ff(SAL)m(T)p Fd(\))472 1873 y
  1342. Fj(Encrypts)f(a)h(string.)354 1938 y
  1343. Fd(eval\()p Ff(EXPR)p Fe(y)n Fd(\))p Fj(*)472 1995 y
  1344. SHAR_EOF
  1345. true || echo 'restore of refbase.ps failed'
  1346. fi
  1347. echo 'End of  part 1'
  1348. echo 'File refbase.ps is continued in part 2'
  1349. echo 2 > _shar_seq_.tmp
  1350. exit 0
  1351. exit 0 # Just in case...
  1352.