Perl Reference Guide 3.044 - Part 3 of 4

Johan Vromans jv at mh.nl
Sat Jan 19 01:27:55 AEST 1991


Submitted-by: jv at mh.nl
Archive-name: perlref3_44_0/part03

---- Cut Here and feed the following to sh ----
#!/bin/sh
# this is perlref_shr.03 (part 3 of perlref3_44_0)
# do not concatenate these parts, unpack them in order with /bin/sh
# file refbase.ps continued
#
if test ! -r _shar_seq_.tmp; then
	echo 'Please unpack part 1 first!'
	exit 1
fi
(read Scheck
 if test "$Scheck" != 3; then
	echo Please unpack part "$Scheck" next!
	exit 1
 else
	exit 0
 fi
) < _shar_seq_.tmp || exit 1
if test ! -f _shar_wnt_.tmp; then
	echo 'x - still skipping refbase.ps'
else
echo 'x - continuing file refbase.ps'
sed 's/^X//' << 'SHAR_EOF' >> 'refbase.ps' &&
537 169 gm
(cmp)show
537 225 gm
(String compare. Returns -1, 0 or 1.)show
552 169 gm
(= ~)show
552 197 gm
(! ~)show
552 225 gm
(Search pattern, substitution, or translation \(negated\).)show
567 169 gm
1 fs
bu fc
2 F /|______Times-Bold fnt
bn
(. .)show
567 225 gm
0 fs
bu fc
2 F /|______Times-Roman fnt
bn
(Enumeration, also input line range operator.)show
582 169 gm
1 fs
bu fc
2 F /|______Times-Bold fnt
bn
(,)show
582 225 gm
0 fs
bu fc
2 F /|______Times-Roman fnt
bn
(Comma operator.)show
619 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(7. File test operators)show
639 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(These unary operators takes one argument, either a filename or a filehandle,)show
653 169 gm
(and tests the associated file to see if something is true about it. If the argument)show
667 169 gm
(is omitted, tests $_ \(except for -t, which tests STDIN\). If the special argument)show
681 169 gm
(_ \(underscore\) is passed, uses the info of the preceding test.)show
698 169 gm
(\320r /\320w /\320x /\320o        File is readable/writable/executable/owned by effective uid.)show
715 169 gm
(\320R /\320W /\320X /\320O    File is readable/writable/executable/owned by real uid.)show
732 169 gm
(\320e /\320z /\320s)show
732 225 gm
(File exists / has zero/non-zero size.)show
749 169 gm
(\320f /\320d)show
749 225 gm
(File is a plain file, a directory.)show
766 169 gm
(\320l /\320S /\320p)show
766 225 gm
(File is a symbolic link, a socket,  a named pipe \(FIFO\).)show
783 169 gm
(\320b /\320c)show
783 225 gm
(File is a block/character special file.)show
800 169 gm
(\320u /\320g /\320k)show
800 225 gm
(File has setuid/setgid/sticky bit set.)show
817 169 gm
(\320t)show
817 225 gm
(Tests if filehandle \(STDIN by default\) is opened to a tty.)show
834 169 gm
(\320T /\320B)show
834 225 gm
(File is a text/non-text \(binary\) file.  Both \320T and \320B return TRUE)show
848 225 gm
(on a null file, or a file at EOF when testing a filehandle.)show
865 169 gm
(\320M / \320A / \320C)show
879 225 gm
(File creation / access / inode change time. Measured in days since)show
893 225 gm
(this program started. See also \322$^T\323 in section \322Special)show
907 225 gm
(Variables\323.)show
F T cp
%%Page: ? 5
op
44 42 xl
1 1 pen
907 279 gm
(nc 44 42 1212 844 6 rc)kp
122 169 gm
1 setTxMode
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(An * after the parameter list indicates that this function may be used either as a)show
136 169 gm
(function or as a unary operator, without the parentheses.)show
153 169 gm
(The symbol \240 after a parameter indicates that this parameter will default to $_)show
167 169 gm
(if omitted.)show
204 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(8. Arithmetic functions)show
224 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(atan2\(Y,X\))show
238 197 gm
(Returns the arctangent of Y/X in the range -)show
currentfont SwToSym
(p)show
setfont
(  to )show
currentfont SwToSym
(p)show
setfont
( .)show
255 169 gm
(cos\(EXPR\240\)*)show
269 197 gm
(Returns the cosine of EXPR \(expressed in radians\).)show
286 169 gm
(exp\(EXPR\240\)*)show
300 197 gm
(Returns e to the power of EXPR.)show
317 169 gm
(int\(EXPR\240\)*)show
331 197 gm
(Returns the integer portion of EXPR.)show
348 169 gm
(log\(EXPR\240\)*)show
362 197 gm
(Returns natural logarithm \(base )show
2 fs
bu fc
2 F /|______Times-Italic fnt
bn
(e)show
0 fs
bu fc
2 F /|______Times-Roman fnt
bn
( \) of EXPR.)show
379 169 gm
(rand [\(EXPR\)*])show
393 197 gm
(Returns a random fractional number between 0 and the value of EXPR.)show
407 197 gm
(If EXPR is omitted, returns a value between 0 and 1.)show
424 169 gm
(sin\(EXPR\240\)*)show
438 197 gm
(Returns the sine of EXPR \(expressed in radians\).)show
455 169 gm
(sqrt\(EXPR\240\)*)show
469 197 gm
(Return the square root of EXPR.)show
486 169 gm
(srand[\(EXPR\)*])show
500 197 gm
(Sets the random number seed for the rand operator.)show
517 169 gm
(time)show
517 197 gm
(Returns the number of seconds since January 1, 1970. Suitable for)show
531 197 gm
(feeding to gmtime\(...\) and localtime\(...\).)show
568 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(9. Conversion functions)show
588 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(gmtime\(EXPR\)*)show
602 197 gm
(Converts a time as returned by the time function to a 9-element array)show
616 197 gm
(\($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst\) with the)show
630 197 gm
(time analyzed for the Greenwich timezone. $mon has the range 0..11 and)show
644 197 gm
($wday has the range 0..6.)show
661 169 gm
(hex\(EXPR\240\)*)show
675 197 gm
(Returns the decimal value of EXPR interpreted as an hex string.)show
692 169 gm
(localtime\(EXPR\)*)show
706 197 gm
(Converts a time as returned by the time function to a 9-element array)show
720 197 gm
(with the time analyzed for the local timezone.)show
737 169 gm
(oct\(EXPR\240\)*)show
751 197 gm
(Returns the decimal value of EXPR interpreted as an octal string. If)show
765 197 gm
(EXPR starts off with 0x, interprets it as a hex string instead.)show
782 169 gm
(ord\(EXPR\240\)*)show
796 197 gm
(Returns the ascii value of the first character of EXPR.)show
813 169 gm
(vec\(EXPR,OFFSET,BITS\))show
827 197 gm
(Treats EXPR as a string of unsigned ints, and yields the bit at OFFSET.)show
841 197 gm
(BITS must be between 1 and 32. May be used as an lvalue.)show
F T cp
%%Page: ? 6
op
44 42 xl
1 1 pen
841 480 gm
(nc 44 42 1212 844 6 rc)kp
122 169 gm
1 setTxMode
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(A LIST is a \(possibly parenthesised\) list of expressions, variables or LISTs.)show
136 169 gm
(An array variable or an array slice may always be used instead of a LIST.)show
173 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(10. Structure conversion)show
193 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(pack\(TEMPLATE,LIST\))show
207 197 gm
(Packs the values into a binary structure using TEMPLATE.)show
224 169 gm
(unpack\(TEMPLATE,EXPR\))show
238 197 gm
(Unpacks the structure EXPR into an array, using TEMPLATE.)show
255 197 gm
(TEMPLATE is a sequence of characters as follows:)show
272 228 gm
(a)show
272 244 gm
(/)show
272 258 gm
(A)show
272 279 gm
(Ascii string, null/space padded)show
289 228 gm
(c)show
289 244 gm
(/)show
289 258 gm
(C)show
289 279 gm
(Native/unsigned char value)show
306 228 gm
(s)show
306 244 gm
(/)show
306 258 gm
(S)show
306 279 gm
(Signed/unsigned short value)show
323 228 gm
(i)show
323 244 gm
(/)show
323 258 gm
(I)show
323 279 gm
(Signed/unsigned integer value)show
340 228 gm
(l)show
340 244 gm
(/)show
340 258 gm
(L)show
340 279 gm
(Signed/unsigned long value)show
357 228 gm
(n)show
357 244 gm
(/)show
357 258 gm
(N)show
357 279 gm
(Short/long in network byte order)show
374 228 gm
(f)show
374 244 gm
(/)show
374 258 gm
(d)show
374 279 gm
(Single/double float in native format)show
391 228 gm
(b)show
391 244 gm
(/)show
391 258 gm
(B)show
391 279 gm
(Bit string in ascending / descending order)show
408 228 gm
(h)show
408 244 gm
(/)show
408 258 gm
(H)show
408 279 gm
(Hex string, low / high nybble first.)show
425 228 gm
(u)show
425 244 gm
(/)show
425 258 gm
(p)show
425 279 gm
(Uuencoded string / Pointer to a string)show
442 228 gm
(x)show
442 244 gm
(/)show
442 258 gm
(@)show
442 279 gm
(Null byte / null fill until position)show
459 228 gm
(X)show
459 279 gm
(Backup a byte)show
476 169 gm
(Each character may be followed by a decimal number which will be used as a)show
490 169 gm
(repeat count, a \322*\323 specifies all remaining arguments.)show
504 169 gm
(If the format is preceded with \322)show
2 fs
bu fc
2 F /|______Times-Italic fnt
bn
(%n)show
0 fs
bu fc
2 F /|______Times-Roman fnt
bn
(\323, \322unpack\323 returns an )show
2 fs
bu fc
2 F /|______Times-Italic fnt
bn
(n)show
0 fs
bu fc
2 F /|______Times-Roman fnt
bn
(-bit checksum)show
518 169 gm
(instead.)show
532 169 gm
(Spaces may be included in the template for readability purposes.)show
569 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(11. String functions)show
589 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(chop\(LIST\240\))show
603 197 gm
(Chops off the last character on all elements of the list; returns the last)show
617 197 gm
(chopped character. The parentheses may be omitted if LIST is a single)show
631 197 gm
(variable.)show
648 169 gm
(crypt\(PLAINTEXT,SALT\))show
662 197 gm
(Encrypts a string.)show
679 169 gm
(eval\(EXPR\240\)*)show
693 197 gm
(EXPR is parsed and executed as if it were a little perl program. The)show
707 197 gm
(value returned is the value of the last expression evaluated. If there is a)show
721 197 gm
(syntax error or runtime error, an undefined string is returned by eval, and)show
735 197 gm
($@ is set to the error message.)show
752 169 gm
(index\(STR,SUBSTR[,OFFSET]\))show
766 197 gm
(Returns the position of SUBSTR in STR at or after OFFSET. If the)show
780 197 gm
(substring is not found, returns $[ \320 1.)show
797 169 gm
(length\(EXPR\240\)*)show
811 197 gm
(Returns the length in characters of the value of EXPR.)show
828 169 gm
(rindex\(STR,SUBSTR[,OFFSET]\))show
842 197 gm
(Returns the position of the last occurrence of SUBSTR in STR at or)show
856 197 gm
(before OFFSET.)show
873 169 gm
(substr\(EXPR,OFFSET[,LEN]\))show
887 197 gm
(Extracts a substring out of EXPR and returns it. If OFFSET is negative,)show
901 197 gm
(counts from the end of the string. May be used as an lvalue.)show
F T cp
%%Page: ? 7
op
44 42 xl
1 1 pen
901 483 gm
(nc 44 42 1212 844 6 rc)kp
125 169 gm
1 setTxMode
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(12. Array and list functions)show
145 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(delete  $ARRAY{KEY})show
159 197 gm
(Deletes the specified value from the specified associative array. Returns)show
173 197 gm
(the deleted value.)show
190 169 gm
(each\(%ARRAY\)*)show
204 197 gm
(Returns a 2-element array consisting of the key and value for the next)show
218 197 gm
(value of an associative array. Entries are returned in an apparently)show
232 197 gm
(random order. When the array is entirely read, a null array is returned.)show
246 197 gm
(The next call to each\(...\) after that will start iterating again.)show
263 169 gm
(grep\(EXPR,LIST\))show
277 197 gm
(Evaluates EXPR for each element of the LIST, locally setting $_ to refer)show
291 197 gm
(to the element. Modifying $_ will modify the corresponding element)show
305 197 gm
(from LIST. Returns array of elements from LIST for which EXPR)show
319 197 gm
(returned true.)show
336 169 gm
(join\(EXPR,LIST\))show
350 197 gm
(Joins the separate strings of LIST into a single string with fields)show
364 197 gm
(separated by the value of EXPR, and returns the string.)show
381 169 gm
(keys\(%ARRAY\)*)show
395 197 gm
(Returns a normal array consisting of all the keys of the named)show
409 197 gm
(associative array.)show
426 169 gm
(pop\(@ARRAY\)*)show
440 197 gm
(Pops and returns the last value of the array, shortens the array by 1.)show
457 169 gm
(push\(@ARRAY,LIST\))show
471 197 gm
(Pushes the values of LIST onto the end of ARRAY. The length of)show
485 197 gm
(ARRAY increases by the length of LIST.)show
502 169 gm
(reverse\(LIST\)*)show
516 197 gm
(In array context: returns the LIST in reverse order. In scalar context:)show
530 197 gm
(returns the first element of LIST with bytes reversed.)show
547 169 gm
(shift[\(@ARRAY\)*])show
561 197 gm
(Shifts the first value of the array off and returns it, shortening the array)show
575 197 gm
(by 1 and moving everything down. If @ARRAY is omitted, shifts)show
589 197 gm
(@ARGV in main and @_ in subroutines.)show
606 169 gm
(sort\([SUBROUTINE] LIST\)*)show
620 197 gm
(Sorts the LIST and returns the sorted array value. If SUBROUTINE is)show
634 197 gm
(specified, gives the name of a subroutine that returns less than zero, zero,)show
648 197 gm
(or greater than zero, depending on how the elements of the array,)show
662 197 gm
(available to the routine as $a and $b, are to be ordered.)show
679 169 gm
(splice\(@ARRAY,OFFSET[,LENGTH[,LIST]]\))show
693 197 gm
(Removes the elements of @ARRAY designated by OFFSET and)show
707 197 gm
(LENGTH, and replaces them with LIST \(if specified\).)show
721 197 gm
(Returns the elements removed.)show
738 169 gm
(split[\(/PATTERN/[,EXPR\240[,LIMIT]]\)])show
752 197 gm
(Splits a string into an array of strings, and returns it. If LIMIT is)show
766 197 gm
(specified, splits in no more than that many fields. If PATTERN is also)show
780 197 gm
(omitted, splits on whitespace \(/[)show
780 351 gm
(\\)show
780 355 gm
(t)show
780 360 gm
(\\)show
780 364 gm
(n)show
780 371 gm
(])show
780 376 gm
(+/\). If not in array context: returns)show
794 197 gm
(number of fields and splits to @_ .)show
811 169 gm
(unshift\(@ARRAY,LIST\))show
825 197 gm
(Prepends list to the front of the array, and returns the number of elements)show
839 197 gm
(in the new array.)show
856 169 gm
(values\(%ARRAY\)*)show
870 197 gm
(Returns a normal array consisting of all the values of the named)show
884 197 gm
(associative array.)show
F T cp
%%Page: ? 8
op
44 42 xl
1 1 pen
884 280 gm
(nc 44 42 1212 844 6 rc)kp
125 169 gm
1 setTxMode
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(13. File operations)show
145 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(Functions operating on a list of files return the number of files successfully)show
159 169 gm
(operated upon.)show
176 169 gm
(chmod\(LIST\)*)show
190 197 gm
(Changes the permissions of a list of files. The first element of the list)show
204 197 gm
(must be the numerical mode.)show
221 169 gm
(chown\(LIST\)*)show
235 197 gm
(Changes the owner and group of a list of files. The first two elements of)show
249 197 gm
(the list must be the numerical uid and gid.)show
266 169 gm
(truncate\(FILE,SIZE\))show
280 197 gm
(truncates FILE to SIZE. FILE may be a filename or a filehandle.)show
297 169 gm
(link\(OLDFILE,NEWFILE\))show
311 197 gm
(Creates a new filename linked to the old filename.)show
328 169 gm
(lstat\(FILE\))show
342 197 gm
(Like stat, but does not traverse a final symbolic link.)show
359 169 gm
(mkdir\(DIR,MODE\))show
373 197 gm
(Creates a directory with given permissions. Sets $! on failure.)show
390 169 gm
(select\(RBITS,WBITS,NBITS,TIMEOUT\))show
404 197 gm
(Performs a select\(2\) system call with the same parameters.)show
421 169 gm
(readlink\(EXPR\240\)*)show
435 197 gm
(Returns the value of a symbolic link.)show
452 169 gm
(rename\(OLDNAME,NEWNAME\))show
466 197 gm
(Changes the name of a file.)show
483 169 gm
(rmdir\(FILENAME\240\)*)show
497 197 gm
(Deletes the directory if it is empty. Sets $! on failure.)show
514 169 gm
(stat\(FILE\))show
528 197 gm
( Returns a 13-element array \($dev, $ino, $mode, $nlink, $uid, $gid,)show
542 197 gm
($rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks\). FILE can be a)show
556 197 gm
(filehandle, an expression evaluating to a filename, or _ to refer to the last)show
570 197 gm
(file test operation.)show
587 169 gm
(symlink\(OLDFILE,NEWFILE\))show
601 197 gm
(Creates a new filename symbolically linked to the old filename.)show
618 169 gm
(unlink\(LIST\)*)show
632 197 gm
(Deletes a list of files.)show
649 169 gm
(utime\(LIST\)*)show
663 197 gm
(Changes the access and modification times. The first two elements of the)show
677 197 gm
(list must be the numerical access and modification times.)show
714 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(14. Directory reading routines)show
734 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(closedir\(DIRHANDLE\)*)show
748 197 gm
(Closes a directory opened by opendir.)show
765 169 gm
(opendir\(DIRHANDLE,DIRNAME\))show
779 197 gm
(Opens a directory on the handle specified.)show
796 169 gm
(readdir\(DIRHANDLE\)*)show
810 197 gm
(Returns the next entry \(or an array of entries\) in the directory.)show
827 169 gm
(rewinddir\(DIRHANDLE\)*)show
841 197 gm
(Positions the directory to the beginning.)show
858 169 gm
(seekdir\(DIRHANDLE,POS\))show
872 197 gm
(Sets position for readdir on the directory.)show
889 169 gm
(telldir\(DIRHANDLE\)*)show
903 197 gm
(Returns the postion in the directory.)show
F T cp
%%Page: ? 9
op
44 42 xl
1 1 pen
903 369 gm
(nc 44 42 1212 844 6 rc)kp
125 169 gm
1 setTxMode
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(15. Input / Output)show
145 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(In input/output operations, FILEHANDLE may be a filehandle as opened by)show
159 169 gm
(the \322open\323 operator, or a scalar variable which evaluates to the name of a)show
173 169 gm
(filehandle to be used.)show
190 169 gm
(binmode\(FILEHANDLE\)*)show
204 197 gm
(Arranges for the file opened on FILEHANDLE to be read in \322binary\323)show
218 197 gm
(mode as opposed to \322text\323 mode \(MS-DOS only\).)show
235 169 gm
(close\(FILEHANDLE\)*)show
249 197 gm
(Closes the file or pipe associated with the file handle.)show
266 169 gm
(dbmclose\(%ARRAY\)*)show
280 197 gm
(Breaks the binding between the array and the dbm file.)show
297 169 gm
(dbmopen\(%ARRAY,DBMNAME, MODE\))show
311 197 gm
(Binds a dbm or ndbm file to the associative array. If the database does)show
325 197 gm
(not exist, it is created with the indicated mode.)show
342 169 gm
(eof\(FILEHANDLE\))show
356 197 gm
(Returns 1 if the next read will return end of file, or if the file is not open.)show
373 169 gm
(eof)show
373 197 gm
(Returns the eof status for the last file read.)show
390 169 gm
(eof\( \))show
404 197 gm
(Indicates eof on the pseudo file formed of the files listed on the)show
418 197 gm
(command line.)show
435 169 gm
(fcntl\(FILEHANDLE,FUNCTION,$VAR\))show
449 197 gm
(Implements the fcntl\(2\) function. This function has non-standard return)show
463 197 gm
(values. See the manual for details.)show
480 169 gm
(fileno\(FILEHANDLE\)*)show
494 197 gm
(Returns the file descriptor for a given \(open\) file.)show
511 169 gm
(flock\(FILEHANDLE,OPERATION\))show
525 197 gm
(Calls flock\(2\) on the file. OPERATION adds from 1 \(shared\), 2)show
539 197 gm
(\(exclusive\), 4 \(non-blocking\) or 8 \(unlock\).)show
556 169 gm
(getc[\(FILEHANDLE\)*])show
570 197 gm
(Yields the next character from the file, or NULL on EOF. If)show
584 197 gm
(FILEHANDLE is omitted, reads from STDIN.)show
601 169 gm
(ioctl\(FILEHANDLE,FUNCTION,$VAR\))show
615 197 gm
(performs ioctl\(2\) on the file. This function has non-standard return)show
629 197 gm
(values. See the manual for details.)show
646 169 gm
(open\(FILEHANDLE[,FILENAME]\))show
660 197 gm
(Opens a file and associates it with FILEHANDLE. If FILENAME is)show
674 197 gm
(omitted, the scalar variable of the same name as the FILEHANDLE must)show
688 197 gm
(contain the filename.  The filename may be optionally preceded by \322>\323,)show
702 197 gm
(\322> >\323 or \322<\323 to select output/append/input mode. Default mode is input.)show
716 197 gm
(Precede with \322+\323 to select read/write access. Use \322&...\323 to connect to an)show
730 197 gm
(already opened filehandle. Pipes to/from commands may be opened with)show
744 197 gm
(\322|...\323 and \322...|\323 . Open returns 1 upon success, undef otherwise, except for)show
758 197 gm
(pipes. The parentheses may be omitted, if only a FILEHANDLE is)show
772 197 gm
(specified.)show
789 169 gm
(pipe\(READHANDLE,WRITEHANDLE\))show
803 197 gm
(Returns a pair of connected pipes.)show
820 169 gm
(print[\([FILEHANDLE] LIST\240\)*])show
834 197 gm
(Prints a string or a comma-separated list of strings. If FILEHANDLE is)show
848 197 gm
(omitted, prints by default to standard output \(or to the last selected)show
862 197 gm
(output channel - see select\(...\)\).)show
879 169 gm
(printf[\([FILEHANDLE] LIST\)*])show
893 197 gm
(Equivalent to \322print FILEHANDLE sprintf\(LIST\)\323.)show
F T cp
%%Page: ? 10
op
44 42 xl
1 1 pen
893 445 gm
(nc 44 42 1212 844 6 rc)kp
122 169 gm
1 setTxMode
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(read\(FILEHANDLE,$VAR,LENGTH[,OFFSET]\))show
136 197 gm
(Read LENGTH binary bytes from the file into the variable at OFFSET.)show
150 197 gm
(Returns number of bytes actually read.)show
167 169 gm
(seek\(FILEHANDLE,POSITION,WHENCE\))show
181 197 gm
(Randomly positions the file. Returns 1 upon success, 0 otherwise.)show
198 169 gm
(select\(FILEHANDLE\)*)show
212 197 gm
(Sets the current default filehandle for output operations. Returns the)show
226 197 gm
(previously selected filehandle.)show
243 169 gm
(sprintf\(FORMAT,LIST\))show
257 197 gm
(Returns a string formatted by \(almost all of\) the usual printf conventions.)show
274 169 gm
(sysread\(FILEHANDLE,$VAR,LENGTH[,OFFSET]\))show
288 197 gm
(Reads LENGTH bytes into $VAR at OFFSET.)show
305 169 gm
(syswrite\(FILEHANDLE,SCALAR,LENGTH[,OFFSET]\))show
319 197 gm
(Writes LENGTH bytes from SCALAR at OFFSET.)show
336 169 gm
(tell[\(FILEHANDLE\)]*)show
350 197 gm
(Returns the current file position for the file. If FILEHANDLE is omitted,)show
364 197 gm
(assumes the file last read.)show
381 169 gm
(write[\(FILEHANDLE\)]*)show
395 197 gm
(Writes a formatted record to the specified file, using the format)show
409 197 gm
(associated with that file. See Formats.)show
446 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(16. Search and replace functions)show
466 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
([EXPR =~] [m]/PATTERN/[i][o])show
480 197 gm
(Searches EXPR \(default: $_\) for a pattern. If you prepend an \322m\323 you)show
494 197 gm
(can use almost any pair of characters as delimiters. If used in array)show
508 197 gm
(context, an array is returned consisting of the subexpressions matched by)show
522 197 gm
(the parentheses in pattern, i.e. \($1,\312$2,\312$3...\).)show
536 197 gm
(Optional modifiers: \322i\323 searches in a case-insensitive manner;)show
550 197 gm
(\322o\323\312interpolates variables only once.)show
567 169 gm
(?PATTERN?)show
581 197 gm
(This is just like the /pattern/ search, except that it matches only once)show
595 197 gm
(between calls to the reset operator.)show
612 169 gm
([$VAR =~] s/PATTERN/REPLACEMENT/[g][i][e][o])show
626 197 gm
(Searches a string for a pattern, and if found, replaces that pattern with)show
640 197 gm
(the replacement text and returns the number of substitutions made.)show
654 197 gm
(Otherwise it returns false.)show
668 197 gm
(Optional modifiers: \322g\323 replaces all occurrences of the pattern;)show
682 197 gm
(\322e\323\312interprets the replacement string as an expression; \322i\323 and \322o\323 as)show
696 197 gm
(with /PATTERN/ matching. Any delimiter may replace the slashes; if)show
710 197 gm
(single quotes are used, no interpretation is done on the replacement)show
724 197 gm
(string.)show
741 169 gm
(study[\($VAR\240\)*])show
755 197 gm
(Study the contents of $VAR in anticipation of doing many pattern)show
769 197 gm
(matches on the contents before it is next modified.)show
786 169 gm
([$VAR =~] tr/SEARCHLIST/REPLACEMENTLIST/[c][d][s])show
800 197 gm
(Translates all occurrences of the characters found in the search list with)show
814 197 gm
(the corresponding character in the replacement list. It returns the number)show
828 197 gm
(of characters replaced. \322y\323 may be used instead of \322tr\323.)show
842 197 gm
(Optional modifiers: \322c\323 complements the SEARCHLIST; \322d\323 deletes all)show
856 197 gm
(characters not found in SEARCHLIST; \322s\323 squeezes all sequences of)show
870 197 gm
(characters that are translated into the same target character into one)show
884 197 gm
(occurrence of this character.)show
F T cp
%%Page: ? 11
op
44 42 xl
1 1 pen
884 332 gm
(nc 44 42 1212 844 6 rc)kp
125 169 gm
1 setTxMode
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(17. System interaction)show
145 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(alarm\(EXPR\)*)show
159 197 gm
(Schedules a SIGALRM to be delivered after EXPR seconds.)show
176 169 gm
(chdir [\(EXPR\)*])show
190 197 gm
(Changes the working directory, $HOME if EXPR is omitted.)show
207 169 gm
(chroot\(FILENAME\240\)*)show
221 197 gm
(Changes the root directory for the the process and its children.)show
238 169 gm
(die[\(LIST\)*])show
252 197 gm
(Prints the value of LIST to STDERR and exits with the current value of)show
266 197 gm
($! \(errno\). If $! is 0, exits with the value of \($? >> 8\) \(\312`command `)show
280 197 gm
(status\). If \($? >> 8\) is 0, exits with 255. LIST defaults to "Died.".)show
297 169 gm
(exec\(LIST\)*)show
311 197 gm
(Executes the system command in LIST; does not return.)show
328 169 gm
(exit\(EXPR\)*)show
342 197 gm
(Exits immediately with the value of EXPR.)show
359 169 gm
(fork)show
359 197 gm
(Does a fork\( \) call. Returns the child pid to the parent process and zero to)show
373 197 gm
(the child process.)show
390 169 gm
(getlogin)show
404 197 gm
(Returns the current login name from /etc/utmp.)show
421 169 gm
(getpgrp[\(PID\)*])show
435 197 gm
(Returns the process group for process PID \(0, or omitted,  means the)show
449 197 gm
(current process\).)show
466 169 gm
(getppid)show
480 197 gm
(Returns the process id of the parent process.)show
497 169 gm
(getpriority\(WHICH,WHO\))show
511 197 gm
(Returns the current priority for a process, process group, or user.)show
528 169 gm
(kill\(LIST\)*)show
542 197 gm
(Sends a signal to a list of processes. The first element of the list must be)show
556 197 gm
(the signal to send \(numeric, or its name as a string\).)show
573 169 gm
(setpgrp\(PID,PGRP\))show
587 197 gm
(Sets the process group for the PID \(0 = current process\).)show
604 169 gm
(setpriority\(WHICH,WHO,PRIO\))show
618 197 gm
(Sets the current priority for a process, process group, or a user.)show
635 169 gm
(sleep[\(EXPR\)*])show
649 197 gm
(Causes the script to sleep for EXPR seconds, or forever if no EXPR.)show
663 197 gm
(Returns the number of seconds actually slept.)show
680 169 gm
(syscall\(LIST\)*)show
694 197 gm
(Calls the system call specified in the first element of the list, passing the)show
708 197 gm
(rest of the list as arguments to the call.)show
725 169 gm
(system\(LIST\)*)show
739 197 gm
(Does exactly the same thing as \322exec LIST\323 except that a fork is done)show
753 197 gm
(first, and the parent process waits for the child process to complete.)show
770 169 gm
(times)show
784 197 gm
(Returns a 4-element array \($user, $system, $cuser, $csystem\) giving the)show
798 197 gm
(user and system times, in seconds, for this process and the children of)show
812 197 gm
(this process.)show
829 169 gm
(umask[\(EXPR\)*])show
843 197 gm
(Sets the umask for the process and returns the old one. If EXPR is)show
857 197 gm
(omitted, returns current umask value.)show
874 169 gm
(wait)show
874 197 gm
(Waits for a child process to terminate and returns the pid of the deceased)show
888 197 gm
(process \(-1 if none\). The status is returned in $? .)show
F T cp
%%Page: ? 12
op
44 42 xl
1 1 pen
888 432 gm
(nc 44 42 1212 844 6 rc)kp
122 169 gm
1 setTxMode
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(waitpid\(PID,FLAGS\))show
136 197 gm
(Performs the same function as the correcponding system call.)show
153 169 gm
(warn\(LIST\)*)show
167 197 gm
(Prints the message on STDERR like die\(...\), but doesn\325t exit.)show
204 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(18. Networking)show
223 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(accept\(NEWSOCKET,GENERICSOCKET\))show
236 197 gm
(Accepts a new socket.)show
252 169 gm
(bind\(SOCKET,NAME\))show
265 197 gm
(Binds the NAME to the SOCKET.)show
281 169 gm
(connect\(SOCKET, NAME\))show
294 197 gm
(Connects the NAME to the SOCKET.)show
310 169 gm
(getpeername\(SOCKET\))show
323 197 gm
(Returns the socket address of the other end of the SOCKET.)show
339 169 gm
(getsockname\(SOCKET\))show
352 197 gm
(Returns the name of the socket.)show
368 169 gm
(getsockopt\(SOCKET,LEVEL,OPTNAME\))show
381 197 gm
(Returns the socket options.)show
397 169 gm
(listen\(SOCKET,QUEUESIZE\))show
410 197 gm
(Starts listening on the specified SOCKET.)show
426 169 gm
(recv\(SOCKET,SCALAR,LENGTH,FLAGS\))show
439 197 gm
(Receives a message on SOCKET.)show
455 169 gm
(send\(SOCKET,MSG,FLAGS[,TO]\))show
468 197 gm
(Sends a message on the SOCKET.)show
484 169 gm
(setsockopt\(SOCKET,LEVEL,OPTNAME,OPTVAL\))show
497 197 gm
(Sets the requested socket option.)show
513 169 gm
(shutdown\(SOCKET,HOW\))show
526 197 gm
(Shuts down a SOCKET.)show
542 169 gm
(socket\(SOCKET,DOMAIN,TYPE,PROTOCOL\))show
555 197 gm
(Creates a SOCKET in DOMAIN with TYPE and PROTOCOL.)show
571 169 gm
(socketpair\(SOCKET1,SOCKET2,DOMAIN,TYPE,PROTOCOL\))show
584 197 gm
(As socket, but creates a pair of bi-directional sockets.)show
621 169 gm
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(19. SystemV IPC)show
641 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(The following functions all perform the same action as the corresponding)show
655 169 gm
(system calls.)show
672 169 gm
(msgctl\(ID,CMD,ARGS\))show
689 169 gm
(msgget\(KEY,FLAGS\))show
706 169 gm
(msgsnd\(ID,MSG,FLAGS\))show
723 169 gm
(msgrcv\(ID,VAR,SIZE,TYPE,FLAGS\))show
740 169 gm
(semctl\(ID,SEMNUM,CMD,ARG\))show
757 169 gm
(semget\(KEY,NSEMS,SIZE,FLAGS\))show
774 169 gm
(semop\(KEY,...\))show
791 169 gm
(shmctl\(ID,CMD,ARG\))show
808 169 gm
(shmget\(KEY,SIZE,FLAGS\))show
825 169 gm
(shmread\(ID,VAR,POS,SIZE\))show
842 169 gm
(shmwrite\(ID,STRING,POS,SIZE\))show
F T cp
%%Page: ? 13
op
44 42 xl
1 1 pen
842 333 gm
(nc 44 42 1212 844 6 rc)kp
125 169 gm
1 setTxMode
1 fs
18 fz
bu fc
2 F /|______Times-Bold fnt
bn
(20. Miscellaneous)show
145 169 gm
0 fs
12 fz
bu fc
2 F /|______Times-Roman fnt
bn
(caller[\(EXPR\)])show
159 197 gm
(Returns an array \($package,$file,$line,\311\) for a specific subroutine call.)show
173 197 gm
SHAR_EOF
true || echo 'restore of refbase.ps failed'
fi
echo 'End of perlref3_44_0 part 3'
echo 'File refbase.ps is continued in part 4'
echo 4 > _shar_seq_.tmp
exit 0
-- 
Johan Vromans				       jv at mh.nl via internet backbones
Multihouse Automatisering bv		       uucp: ..!{uunet,hp4nl}!mh.nl!jv
Doesburgweg 7, 2803 PL Gouda, The Netherlands  phone/fax: +31 1820 62911/62500
------------------------ "Arms are made for hugging" -------------------------



More information about the Alt.sources mailing list