home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1455 (.txt) < prev    next >
LaTeX Document  |  1990-12-28  |  25KB

  1. From: jv@mh.nl (Johan Vromans)
  2. Newsgroups: comp.lang.perl,alt.sources
  3. Subject: TeX version of the Perl Reference Guide - part 1 of 2
  4. Message-ID: <JV.90Jun13103754@squirrel.mh.nl>
  5. Date: 13 Jun 90 16:37:54 GMT
  6. X-Checksum-Snefru: 9884ed9e ac92ddd9 df9a63ad 87bbe6c6
  7. This is a TeX version of the information on the Perl Reference Guide,
  8. based on guide version 3.0.18.2. It will create a printable copy of
  9. the information on the Guide, but not its fancy formatting.
  10. NOTE:    This TeX document has been created by Raymond Chen
  11.     <raymond@math.berkeley.edu>. You should contact him for details
  12.     and remarks. I'm only passing it through.
  13. Submitted-by: Raymond Chen <raymond@math.berkeley.edu>
  14. Archive-name: perlref.tex/part01
  15. ---- Cut Here and unpack ----
  16. #!/bin/sh
  17. # This is perlref.tex, a shell archive (shar 3.24)
  18. # made 06/13/1990 08:34 UTC by jv@squirrel
  19. # Source directory /u/jv/perlref/TeX
  20. # existing files WILL be overwritten
  21. # This is part 1 of a multipart archive                                    
  22. # do not concatenate these parts, unpack them in order with /bin/sh        
  23. # This shar contains:
  24. # length  mode       name
  25. # ------ ---------- ------------------------------------------
  26. #  37522 -rw-r--r-- perlref.tex
  27. if touch 2>&1 | fgrep '[-amc]' > /dev/null
  28.  then TOUCH=touch
  29.  else TOUCH=true
  30. if test -r shar3_seq_.tmp; then
  31.     echo "Must unpack archives in sequence!"
  32.     next=`cat shar3_seq_.tmp`; echo "Please unpack part $next next"
  33.     exit 1
  34. # ============= perlref.tex ==============
  35. echo "x - extracting perlref.tex (Text)"
  36. sed 's/^X//' << 'SHAR_EOF' > perlref.tex &&
  37. X% Perl Reference Guide (for perl version 3.0)
  38. X% Perl designed and created by Larry Wall <lwall@jpl-devvax.jpl.nasa.gov>
  39. X% Reference guide designed and created by Johan Vromans <jv@mh.nl>
  40. X% TeX version by Raymond Chen <raymond@math.berkeley.edu>
  41. X% Copyright 1989, 1990 Johan Vromans
  42. X% TeX version Copyright 1990 Raymond Chen
  43. X% Rev. 3.0.18.1  Use and reproduction of this information is unlimited.
  44. X% Changes to Johan's wording are marked by %%rjc%%
  45. X%%%%%%%%%% This file uses one nonstandard font for the title page.
  46. X% If you don't have it, then change the following \iffalse to \iftrue.
  47. X\iffalse
  48. X    \let\twelvebf=\bf
  49. X\else
  50. X    \font\twelvebf=cmbx12
  51. X%%%%%%%%%% You may steal the following magic macros.
  52. X% Magic:
  53. X% |stuff| puts the stuff in \tt.
  54. X% <stuff> puts the stuff in \it.
  55. X%% verbatim macros
  56. X\chardef\other=12
  57. X\def\ttverbatim{\begingroup \catcode`\\=\other \catcode`\{=\other
  58. X\catcode`\}=\other \catcode`\$=\other \catcode`\&=\other
  59. X\catcode`\#=\other \catcode`\%=\other \catcode`\~=\other
  60. X\catcode`\_=\other \catcode`\^=\other \catcode`\<=\other
  61. X\obeyspaces \obeylines \tt}
  62. X{\catcode`\|=\active
  63. X\obeylines \gdef|{\leavevmode%
  64. X   \ttverbatim \spaceskip.5em plus.25em minus.15em%
  65. X   \let^^M=\  \let|=\endgroup \escapechar`\|}}
  66. X\catcode`\|=\active
  67. X\def\|{\leavevmode\hbox{\tt\char`\|}}
  68. X\catcode`\<=\active
  69. X\def<{\leavevmode\italicizerest}
  70. X\def\italicizerest#1>{{\it#1\/}}
  71. X\def\cstok#1{\leavevmode\thinspace\hbox{\vrule\vtop{\vbox{\hrule\kern1pt%
  72. X  \hbox{\vphantom{\tt/}\thinspace{\tt#1}\thinspace}}%
  73. X  \kern1pt\hrule}\vrule}\thinspace}
  74. X\catcode`\&=\active
  75. X\let&=\undefined
  76. X\def\*{$^\dagger$}
  77. X\newdimen\tablewidth
  78. X\def\table{\everypar={\nextitem}\parindent=0pt\tablewidth}
  79. X\def\endtable{\everypar={}\par}
  80. X\def\outtext{\everypar={\hangindent=3pc\relax}\parindent0pt\relax}
  81. X\def\text{\everypar={}\parindent0pt\relax}
  82. X\def\nextitem{\bgroup\let\par\means\obeylines\global\setbox0=\hbox\bgroup}
  83. X\def\means{\enskip\egroup\egroup
  84. X    \ifdim\wd0>\tablewidth
  85. X       \hangindent\tablewidth
  86. X       \box0\hfill\break
  87. X       \hskip\tablewidth
  88. X    \else\hangindent\tablewidth
  89. X          \hbox to\tablewidth{\box0\hss}%
  90. X    \fi\ignorespaces}
  91. X%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  92. X\centerline{\twelvebf Perl Reference Guide}
  93. X\centerline{\bf for perl version 3.0}
  94. X\medskip
  95. X\hbox to \hsize{\hss
  96. X      Perl program designed and
  97. X      created by Larry Wall |<lwall@jpl-devvax.jpl.nasa.gov>|\hss}
  98. X\hbox to \hsize{\hss
  99. X      Reference guide designed and created by Johan Vromans |<jv@mh.nl>|\hss}
  100. X\hbox to \hsize{\hss
  101. X      \TeX\ version by Raymond Chen |<raymond@math.berkeley.edu>|\hss}
  102. X\medskip
  103. X\centerline{Copyright \copyright 1989, 1990 Johan Vromans}
  104. X\centerline{\TeX\ version Copyright 1990 Raymond Chen}
  105. X\centerline{Rev. 3.0.18.1}
  106. X\centerline{Use and reproduction of this information is unlimited.}
  107. X\bigskip
  108. X\centerline{\bf Contents}
  109. X\bigskip
  110. X\line{\hss\catcode`\?=\active \let?=\space
  111. X\def\<#1. #2.{\hbox{#1\quad#2}}
  112. X\vbox{
  113. X\<?1. Command line options.
  114. X\<?2. Literals.
  115. X\<?3. Variables.
  116. X\<?4. Statements.
  117. X\<?5. Flow control.
  118. X\<?6. Operators.
  119. X\<?7. File test operators.
  120. X\<?8. Arithmetic functions.
  121. X\<?9. Conversion functions.
  122. X\<10. Structure conversion.
  123. X\<11. String functions.
  124. X\<12. Array and list functions.
  125. X}\qquad\vbox{
  126. X\<13. File operations.
  127. X\<14. Directory reading routines.
  128. X\<15. Input/Output.
  129. X\<16. Search and replace functions.
  130. X\<17. System interaction.
  131. X\<18. Networking.
  132. X\<19. Miscellaneous.
  133. X\<20. Info from system files.
  134. X\<21. Regular expressions.
  135. X\<22. Formats.
  136. X\<23. Special variables.
  137. X\<24. Special arrays.
  138. X}\hss}
  139. X\beginsection 1. Command line options
  140. X\table1.2in
  141. X|-a|
  142. Xturns on autosplit mode when used with |-n| or |-p|.  Splits to |@F|.
  143. X|-d|
  144. Xruns the script under the debugger. Use ``|-de 0|'' to start the
  145. Xdebugger without a script.
  146. X|-D|<number>
  147. Xsets debugging flags.
  148. X|-e| <commandline>
  149. X    may be used to enter one line of script. Multiple
  150. X    |-e| commands may be given to build up a multi-line script.
  151. X|-i|<extension>
  152. X        specifies that files processed by
  153. X        the |<>| construct are to be edited in-place.
  154. X|-I|<directory>
  155. X        with |-P|:  tells the C preprocessor where to look
  156. X        for include files.
  157. X|-n|
  158. Xassumes an input loop around your script. Lines are not printed.
  159. X|-p|
  160. Xassumes an input loop around your script. Lines are printed.
  161. X|-P|
  162. Xruns the C preprocessor on the script before compilation by perl.
  163. X|-s|
  164. X    interprets ``|-xxx|'' on the command line as switches and sets the
  165. X    corresponding variables |$xxx| in the script.
  166. X|-S|
  167. Xuses the |PATH| environment variable to search for the script.
  168. X|-u|
  169. Xdumps core after compiling the script.
  170. X|-U|
  171. Xallows perl to do unsafe operations.
  172. X|-v|
  173. Xprints the version and patchlevel of your perl executable.
  174. X|-w|
  175. X     prints warnings about possible spelling errors and other error-prone
  176. X     constructs in the script.
  177. X\endtable
  178. X\beginsection 2. Literals
  179. X\outtext
  180. XNumeric: |123|,  |123.4|,  |5E-10|,  |0xff| (hex),  |0377| (octal).
  181. XString: |"abc"|,  |'abc'|.
  182. X   Variables are interpolated when |"|\dots|"| are used. \hfil\break
  183. X   |q/|\dots|/|
  184. X   can be used instead of |'|\dots|'|, |qq/|\dots|/| instead of |"|\dots|"|,
  185. X   (any delimiter instead of |/|\dots|/|).
  186. XArray: |(1,2,3)|. |()| is empty array.
  187. X    Also: |($a,$b,@rest) = (1,2,|\dots|);|
  188. X    Enums are fine: |(1..4)| is |(1,2,3,4)|. Likewise |('abc'..'ade')|.
  189. XFilehandles:
  190. X|<STDIN>|, |<STDOUT>|, |<STDERR>|, |<handle>|, |<$var>|.
  191. X|<>| is the input stream formed by the files specified in |@ARGV|,
  192. Xor |STDIN| if no arguments are supplied.
  193. XGlobs:
  194. X|<pattern>| evaluates to all filenames according to the pattern.
  195. XUse |<${var}>| to glob from a variable.
  196. XCommands:
  197. X|`command`| evaluates to the output of the command.
  198. XHere-Is: |<<identifier| |#| the identifier must follow |<<| immediately
  199. X                            \hfill\break
  200. X{\it input text}            \hfill\break
  201. X|identifier|
  202. X\beginsection 3. Variables
  203. X\table 1.2in
  204. X|$var|
  205. X          a simple scalar variable
  206. X|$var[28]|
  207. X          29th element of array |@var| (the |[]| are part of it)
  208. X|$var{'Feb'}|
  209. X          one value from associative array |%var|
  210. X|$#var|
  211. X          last index of array |@var|
  212. X|@var|
  213. X          the entire array
  214. X|@var[3,4,5]|
  215. X          a slice of the array |@var|
  216. X|@var{'a','b'}|
  217. X          a slice of |%var|; same as |($var{'a'},$var{'b'})|
  218. X|%var|
  219. X          the entire associative array
  220. X|$var{'a',1,|\dots|}|
  221. X          emulates a multi-dimensional array
  222. X|('a',1,|\dots|)[4]|
  223. X          subscripts an array literal
  224. X|*name|
  225. X          refers to all objects represented by name.      \hfil\break
  226. X          ``|*name1 = *name2|'' makes |name1| identical to |name2|.
  227. X\endtable
  228. X\beginsection 4. Statements
  229. X\text
  230. XEvery statement is an expression, optionally followed by a modifier, and
  231. Xterminated by a semi-colon.
  232. XExecution of expressions can depend on other expressions using one of
  233. Xthe modifiers ``if'', ``unless'', ``while'' or ``until'', e.g.:
  234. X$$\vbox{
  235. X\hbox{<EXPR1> if <EXPR2>;}
  236. X\hbox{<EXPR1> until <EXPR2>;}}$$
  237. XAlso, by using one of the logical operators ``\|\|'', ``|&&|''
  238. Xor ``|?:|'', e.g.:
  239. X$$\vbox{
  240. X\hbox{<EXPR1> \|\| <EXPR2>;}
  241. X\hbox{<EXPR1> ? <EXPR2> : <EXPR3>;}}$$
  242. XStatements can be combined to form a <BLOCK> when enclosed in |{}|.
  243. XCompound statements may be used to control flow (|[]| denote optional
  244. Xparts, \* means: defaults to |$_| if omitted):
  245. X$$\vbox{
  246. X\hbox{if (<EXPR>) <BLOCK> [ [ elsif (<EXPR>) <BLOCK> \dots\ ] else <BLOCK> ]}
  247. X\hbox{unless (<EXPR>) <BLOCK> [ else <BLOCK> ]}
  248. X\hbox{[<LABEL>:] while (<EXPR>) <BLOCK> [ continue <BLOCK> ]}
  249. X\hbox{[<LABEL>:] until (<EXPR>) <BLOCK> [ continue <BLOCK> ]}
  250. X\hbox{[<LABEL>:] for (<EXPR>; <EXPR>; <EXPR>) <BLOCK>}
  251. X\hbox{[<LABEL>:] foreach <VAR>\*\ (<ARRAY>) <BLOCK>}
  252. X\hbox{[<LABEL>:] <BLOCK> [ continue <BLOCK> ]}}$$
  253. XSpecial forms are:
  254. X$$\vbox{
  255. X\hbox{do <BLOCK> while <EXPR>;}
  256. X\hbox{do <BLOCK> until <EXPR>;}}$$
  257. Xwhich are guaranteed to perform <BLOCK> once before testing <EXPR>.
  258. X\beginsection 5. Flow control
  259. X\table 1in
  260. Xdo <BLOCK>
  261. XReturns the value of the last command in the sequence of
  262. Xcommands indicated by <BLOCK>.
  263. Xdo <SUBROUTINE> (<LIST>)
  264. XExecutes a <SUBROUTINE> declared by a |sub| declaration, and
  265. Xreturns the value of the last expression evaluated in
  266. X<SUBROUTINE>. Also: |&|<SUBROUTINE>.
  267. Xdo <EXPR>
  268. XUses the value of <EXPR> as a filename and executes the contents of
  269. Xthe file as a perl script. Errors are returned in |$@|.
  270. Xgoto <LABEL>
  271. XContinue execution at the specified label.
  272. Xlast [<LABEL>]
  273. XImmediately exits the loop in question. Skips continue block.
  274. Xnext [<LABEL>]
  275. XStarts the next iteration of the loop.
  276. Xredo [<LABEL>]
  277. XRestarts the loop block without evaluating the conditional again.
  278. Xreturn <EXPR>
  279. XReturns from a subroutine with the value specified.
  280. X\endtable
  281. X\beginsection 6. Operators
  282. X\table 1in
  283. X|+|  |-|  |*|  |/|
  284. XAddition, subtraction, multiplication, division.
  285. XModulo division.
  286. X\|    |&|   |^|
  287. XBitwise or, bitwise and, bitwise exclusive or.
  288. X|>>|  |<<|
  289. XBitwise shift right, bitwise shift left.
  290. X|**|
  291. XExponentiation.
  292. XConcatenation of two strings.
  293. XReturns a string consisting of the left operand repeated the
  294. Xnumber of times specified by the right operand.
  295. X\medskip\noindent
  296. XAll of the above operators also have an assignment operator, e.g. ``|.=|''.
  297. X\medskip
  298. X|++| |--|
  299. XAuto-increment (magical on strings), auto-decrement.
  300. X|?:|
  301. XAlternation (if-then-else) operator.
  302. X\|\| |&&|
  303. XLogical or, logical and.
  304. X|==| |!=|
  305. XNumeric equality, inequality.
  306. X|eq| |ne|
  307. XString equality, inequality.
  308. X|<| |>|
  309. XNumeric less than, greater than.
  310. X|lt| |gt|
  311. XString less than, greater than.
  312. X|<=| |>=|
  313. XNumeric less (greater) than or equal to.
  314. X|le| |ge|
  315. XString less (greater) than or equal.
  316. X|=~| |!~|
  317. XSearch pattern, substitution, or translation (negated).
  318. X|..|
  319. XEnumeration, also input line range operator.
  320. XComma operator.
  321. X\endtable
  322. X\beginsection 7. File test operators
  323. X\text
  324. X%%rjc%% Changed "This unary operator" to "These unary operators"
  325. X%%rjc%%  and concomitant grammar changes
  326. XThese unary operators take one argument, either a filename or a
  327. Xfilehandle, and test the associated file to see if something is true about
  328. Xit. If the argument is omitted, tests |$_|
  329. X(except for |-t|, which tests |STDIN|).
  330. XIf the special argument |_| (underscore) is passed, uses the info of the
  331. Xpreceding test.
  332. X\medskip
  333. X\table 1in
  334. X|-r|/|-w|/|-x|/|-o|
  335. XFile is readable/writable/executable/owned by effective uid.
  336. X|-R|/|-W|/|-X|/|-O|
  337. XFile is readable/writable/executable/owned by real uid.
  338. X|-e|/|-z|/|-s|
  339. XFile exists / has zero/non-zero size.
  340. X|-f|/|-d|
  341. XFile is a plain file, a directory.
  342. X|-l|/|-S|/|-p|
  343. XFile is a symbolic link, a socket,  a named pipe (FIFO).
  344. X|-b|/|-c|
  345. XFile is a block/character special file.
  346. X|-u|/|-g|/|-k|
  347. XFile has setuid/setgid/sticky bit set.
  348. X|-t|
  349. XTests if filehandle (STDIN by default) is opened to a tty.
  350. X|-T|/|-B|
  351. XFile is a text/non-text (binary) file.  Both |-T| and |-B| return
  352. X<TRUE> on a null file, or a file at EOF when testing a
  353. Xfilehandle.
  354. X\text
  355. X\medskip
  356. XAn |*| after the parameter list indicates that this function may be used
  357. Xeither as a function or as a unary operator, without the parentheses.
  358. XThe symbol \*\ after a parameter indicates that this parameter will default
  359. Xto |$_| if omitted.
  360. X\beginsection 8. Arithmetic functions
  361. X\table1.2in
  362. Xatan2($X$,$Y$)
  363. XReturns the arctangent of $X/Y$ in the range $-\pi$ to $\pi$.
  364. Xcos(<EXPR>\*)*
  365. XReturns the cosine of <EXPR> (expressed in radians).
  366. Xexp(<EXPR>\*)*
  367. XReturns e to the power of <EXPR>.
  368. Xint(<EXPR>\*)*
  369. XReturns the integer portion of <EXPR>.
  370. Xlog(<EXPR>\*)*
  371. XReturns natural logarithm (base $e$) of <EXPR>.
  372. Xrand [(<EXPR>)*]
  373. XReturns a random fractional number between 0 and the value of
  374. X<EXPR>. If <EXPR> is omitted, returns a value between 0 and 1.
  375. Xsin(<EXPR>\*)*
  376. XReturns the sine of <EXPR> (expressed in radians).
  377. Xsqrt(<EXPR>\*)*
  378. XReturn the square root of <EXPR>.
  379. Xsrand[(<EXPR>)*]
  380. XSets the random number seed for the rand operator.
  381. Xtime
  382. XReturns the number of seconds since January 1, 1970. Suitable for
  383. Xfeeding to gmtime(\dots) and localtime(\dots).
  384. X\endtable
  385. X\beginsection 9. Conversion functions
  386. X\table 1.2in
  387. Xgmtime(<EXPR>)*
  388. XConverts a time as returned by the time function to a 9-element
  389. Xarray |($sec, $min, $hour, $mday, $mon, $year, $wday, $yday,
  390. X$isdst)| with the time analyzed for the Greenwich timezone. |$mon|
  391. Xhas the range $0\ldots11$ and |$wday| has the range $0\ldots6$.
  392. X%%rjc%% \* added
  393. Xhex(<EXPR>\*)*
  394. XReturns the decimal value of <EXPR> interpreted as an hex string.
  395. Xlocaltime(<EXPR>)*
  396. XConverts a time as returned by the time function to a 9-element
  397. Xarray with the time analyzed for the local timezone.
  398. X%%rjc%% \* added
  399. Xoct(<EXPR>\*)*
  400. XReturns the decimal value of <EXPR> interpreted as an octal string.
  401. XIf <EXPR> starts off with 0x, interprets it as a hex string instead.
  402. Xord(<EXPR>\*)*
  403. XReturns the ascii value of the first character of <EXPR>.
  404. Xvec(<EXPR>,<OFFSET>,<BITS>)
  405. XTreats <EXPR> as a string of unsigned ints, and yields the bit at
  406. X<OFFSET>. <BITS> must be between 1 and 32. May be used as an
  407. Xlvalue.
  408. X\endtable
  409. X\text
  410. X\medskip
  411. XA <LIST> is a (possibly parenthesised) list of expressions, variables or
  412. X<LIST>s. In all circumstances, an array variable or an array slice may be
  413. Xused instead of a <LIST>.
  414. X\beginsection 10. Structure conversion
  415. X\table 1.2in
  416. Xpack(<TEMPLATE>,<LIST>)
  417. XPacks the values into a binary structure using <TEMPLATE>.
  418. Xunpack(<TEMPLATE>,<EXPR>)
  419. XUnpacks the structure <EXPR> into an array, using <TEMPLATE>.
  420. X\endtable
  421. X\text
  422. X\medskip
  423. X<TEMPLATE> is a sequence of characters as follows:
  424. X\table .4in
  425. X|a|/|A|
  426. X         Ascii string, null/space padded
  427. X|c|/|C|
  428. X         Native/unsigned char value
  429. X|s|/|S|
  430. X         Signed/unsigned short value
  431. X|i|/|I|
  432. X         Signed/unsigned integer value
  433. X|l|/|L|
  434. X         Signed/unsigned long value
  435. X|n|/|N|
  436. X         Short/long in network byte order
  437. X         Pointer to a string
  438. X         Null byte
  439. X\endtable
  440. X\text
  441. X\medskip
  442. XEach character may be followed by a decimal number which will be used
  443. Xas a repeat count. Spaces may be included in the template for readability
  444. Xpurposes.
  445. X\beginsection 11. String functions
  446. X\table 1.2in
  447. Xchop(<LIST>\*)
  448. XChops off the last character on all elements of the list; returns the
  449. Xlast chopped character. The parentheses may be omitted if <LIST> is
  450. Xa single variable.
  451. Xcrypt(<PLAINTEXT>,<SALT>)
  452. XEncrypts a string.
  453. X%%rjc%%\* added
  454. Xeval(<EXPR>\*)*
  455. X<EXPR> is parsed and executed as if it were a little perl program.
  456. XThe value returned is the value of the last expression evaluated. If
  457. Xthere is a syntax error or runtime error, an undefined string is
  458. Xreturned by eval, and |$@| is set to the error message.
  459. Xindex(<STR>,<SUBSTR>)
  460. XReturns the position of <SUBSTR> in <STR>. If the substring is not
  461. Xfound, returns |$[|${}-1$.
  462. X%%rjc%% \* added
  463. Xlength(<EXPR>\*)*
  464. XReturns the length in characters of the value of <EXPR>.
  465. Xrindex(<STR>,<SUBSTR>)
  466. XReturns the position of the last occurrence of <SUBSTR> in <STR>.
  467. Xsubstr(<EXPR>,<OFFSET>,<LEN>)
  468. XExtracts a substring out of <EXPR> and returns it. If <OFFSET> is
  469. Xnegative, counts from the end of the string. May be used as an
  470. Xlvalue.
  471. X\endtable
  472. X\beginsection 12. Array and list functions
  473. X\table 1.2in
  474. Xdelete |$|<ARRAY>$\{$<KEY>$\}$
  475. XDeletes the specified value from the specified associative array.
  476. XReturns the deleted value.
  477. Xeach(|%|<ARRAY>)*
  478. XReturns a 2-element array consisting of the key and value for the
  479. Xnext value of an associative array. Entries are returned in an
  480. Xapparently random order. When the array is entirely read, a null
  481. Xarray is returned. The next call to each(\dots) after that will start
  482. Xiterating again.
  483. Xgrep(<EXPR>,<LIST>)
  484. XEvaluates <EXPR> for each element of the <LIST>, locally setting |$_| to
  485. Xrefer to the element. Modifying |$_| will modify the corresponding
  486. Xelement from <LIST>. Returns array of elements from <LIST> for
  487. Xwhich <EXPR> returned true.
  488. Xjoin(<EXPR>,<LIST>)
  489. XJoins the separate strings of <LIST> into a single string with fields
  490. Xseparated by the value of <EXPR>, and returns the string.
  491. Xkeys(|%|<ARRAY>)*
  492. XReturns a normal array consisting of all the keys of the named
  493. Xassociative array.
  494. Xpop(|@|<ARRAY>)*
  495. XPops and returns the last value of the array, shortens the array by 1.
  496. Xpush(|@|<ARRAY>,<LIST>)
  497. XPushes the values of <LIST> onto the end of <ARRAY>. The length of
  498. X<ARRAY> increases by the length of <LIST>.
  499. Xreverse(<LIST>)*
  500. XReturns the <LIST> in reverse order.
  501. Xshift[(|@|<ARRAY>)*]
  502. XShifts the first value of the array off and returns it, shortening the
  503. Xarray by 1 and moving everything down. If |@|<ARRAY> is omitted,
  504. Xshifts |@ARGV| in main and |@_| in subroutines.
  505. Xsort([<SUBROUTINE>] <LIST>)*
  506. XSorts the <LIST> and returns the sorted array value. If
  507. X<SUBROUTINE> is specified, gives the name of a subroutine that
  508. Xreturns less than zero, zero, or greater than zero, depending on how
  509. Xthe elements of the array, available to the routine as |$a| and |$b|, are
  510. Xto be ordered.
  511. Xsplice(|@|<ARRAY>,<OFFSET>[,<LENGTH>[,<LIST>]])
  512. XRemoves the elements of |@|<ARRAY> designated by <OFFSET> and
  513. X<LENGTH>, and replaces them with <LIST> (if specified).
  514. XReturns the elements removed.
  515. Xsplit[(/<PATTERN>/[,<EXPR>\*[,<LIMIT>]])]
  516. XSplits a string into an array of strings, and returns it. If <LIMIT> is
  517. Xspecified, splits in no more than that many fields. If <PATTERN> is
  518. Xalso omitted, splits on whitespace (\hbox{|/[ \t\n]+/|}). If not in array
  519. Xcontext: returns number of fields and splits to |@_|.
  520. Xunshift(|@|<ARRAY>,<LIST>)
  521. XPrepends list to the front of the array, and returns the number of
  522. Xelements in the new array.
  523. Xvalues(|%|<ARRAY>)*
  524. XReturns a normal array consisting of all the values of the named
  525. Xassociative array.
  526. X\endtable
  527. X\beginsection 13. File operations
  528. X\text
  529. XFunctions operating on a list of files return the number of files
  530. Xsuccessfully operated upon.
  531. X\medskip
  532. X\table 1.2in
  533. Xchmod(<LIST>)*
  534. XChanges the permissions of a list of files. The first element of the
  535. Xlist must be the numerical mode.
  536. Xchown(<LIST>)*
  537. XChanges the owner and group of a list of files. The first two
  538. Xelements of the list must be the numerical uid and gid.
  539. Xlink(<OLDFILE>,<NEWFILE>)
  540. XCreates a new filename linked to the old filename.
  541. Xlstat(<FILE>)
  542. XLike stat, but does not traverse a final symbolic link.
  543. Xmkdir(<DIR>,<MODE>)
  544. XCreates a directory with given permissions. Sets |$!| on failure.
  545. Xselect(<RBITS>,<WBITS>,<NBITS>,<TIMEOUT>)
  546. XPerforms a select(2) system call with the same parameters.
  547. Xreadlink(<EXPR>\*)*
  548. XReturns the value of a symbolic link.
  549. Xrename(<OLDNAME>,<NEWNAME>)
  550. XChanges the name of a file.
  551. Xrmdir(<FILENAME>\*)*
  552. XDeletes the directory if it is empty. Sets |$!| on failure.
  553. Xstat(<FILE>)
  554. XReturns a 13-element array |($dev, $ino, $mode, $nlink, $uid, $gid,
  555. X$rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks)|. <FILE> can
  556. Xbe a filehandle, an expression evaluating to a filename, or |_| to refer
  557. Xto the last file test operation. The parentheses may be omitted if
  558. X<FILE> is a filehandle, a variable, or |_|.
  559. Xsymlink(<OLDFILE>,<NEWFILE>)
  560. XCreates a new filename symbolically linked to the old filename.
  561. Xunlink(<LIST>)*
  562. XDeletes a list of files.
  563. Xutime(<LIST>)*
  564. XChanges the access and modification times on each file of a list of
  565. Xfiles. The first two elements of the list must be the numerical
  566. Xaccess and modification times.
  567. X\endtable
  568. X\beginsection 14. Directory reading routines
  569. X\table1.2in
  570. Xclosedir(<DIRHANDLE>)*
  571. XCloses a directory opened by opendir.
  572. Xopendir(<DIRHANDLE>,<DIRNAME>)
  573. XOpens a directory on the handle specified.
  574. Xreaddir(<DIRHANDLE>)*
  575. XReturns the next entry (or an array of entries) in the directory.
  576. Xrewinddir(<DIRHANDLE>)*
  577. XPositions the directory to the beginning.
  578. Xseekdir(<DIRHANDLE>,<POS>)
  579. XSets position for readdir on the directory.
  580. Xtelldir(<DIRHANDLE>)*
  581. XReturns the postion in the directory.
  582. X\endtable
  583. X\beginsection 15. Input/Output
  584. X\text
  585. XIn input/output operations, <FILEHANDLE> may be a filehandle as
  586. Xopened by the ``open'' operator, or a scalar variable which evaluates to
  587. Xthe name of a filehandle to be used.
  588. X\medskip
  589. X\table1.2in
  590. X%%rjc%% MS-DOS properly capitalized
  591. Xbinmode(<FILEHANDLE>)*
  592. XArranges for the file opened on <FILEHANDLE> to be read in
  593. X``binary'' mode as opposed to ``text'' mode (MS-DOS only).
  594. Xclose(<FILEHANDLE>)*
  595. XCloses the file or pipe associated with the file handle.
  596. Xdbmclose(|%|<ARRAY>)*
  597. XBreaks the binding between the array and the dbm file.
  598. Xdbmopen(|%|<ARRAY>,<DBMNAME>, <MODE>)
  599. XBinds a dbm or ndbm file to the associative array. If the database
  600. Xdoes not exist, it is created with the indicated mode.
  601. Xeof(<FILEHANDLE>)
  602. XReturns 1 if the next read will return end of file, or if the file is not
  603. Xopen.
  604. XReturns the eof status for the last file read.
  605. Xeof()
  606. XIndicates eof on the pseudo file formed of the files listed on the
  607. Xcommand line.
  608. Xfcntl(<FILEHANDLE>,<FUNCTION>,|$|<VAR>)
  609. XImplements the fcntl(2) function. This function has non-standard
  610. Xreturn values. See the manual for details.
  611. Xfileno(<FILEHANDLE>)*
  612. XReturns the file descriptor for a given (open) file.
  613. Xflock(<FILEHANDLE>,<OPERATION>)
  614. XCalls flock(2) on the file. <OPERATION> adds from 1 (shared), 2
  615. X(exclusive), 4 (non-blocking) or 8 (unlock).
  616. Xgetc[(<FILEHANDLE>)*]
  617. XYields the next character from the file, or |NULL| on |EOF|. If
  618. X<FILEHANDLE> is omitted, reads from |STDIN|.
  619. Xioctl(<FILEHANDLE>,<FUNCTION>,|$|<VAR>)
  620. Xperforms ioctl(2) on the file. This function has non-standard return
  621. Xvalues. See the manual for details.
  622. Xopen(<FILEHANDLE>[,<FILENAME>])
  623. XOpens a file and associates it with <FILEHANDLE>. If <FILENAME>
  624. Xis omitted, the scalar variable of the same name as the
  625. X<FILEHANDLE> must contain the filename.  The filename may be
  626. Xoptionally preceded by ``|>|'', ``|>>|'' or ``|<|'' to select
  627. Xoutput/append/input mode. Default mode is input. Precede with
  628. X``|+|'' to select read/write access. Use ``|&|\dots'' to connect
  629. Xto an already
  630. Xopened filehandle. Pipes to/from commands may be opened with
  631. X``\|\dots'' and ``\dots\|'' . Open returns 1 upon success, undef otherwise,
  632. Xexcept for pipes. The parentheses may be omitted, if only a
  633. X<FILEHANDLE> is specified.
  634. Xpipe(<READHANDLE>,<WRITEHANDLE>)
  635. XReturns a pair of connected pipes.
  636. Xprint[([<FILEHANDLE>] <LIST>\*)*]
  637. XPrints a string or a comma-separated list of strings. If
  638. X<FILEHANDLE> is omitted, prints by default to standard output (or
  639. SHAR_EOF
  640. echo "End of perlref.tex part 1"
  641. echo "File perlref.tex is continued in part 2"
  642. echo "2" > shar3_seq_.tmp
  643. exit 0
  644. Johan Vromans                       jv@mh.nl via internet backbones
  645. Multihouse Automatisering bv               uucp: ..!{uunet,hp4nl}!mh.nl!jv
  646. Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62944/62500
  647. ------------------------ "Arms are made for hugging" -------------------------
  648.