|
|
- /regexp/
- See m/regexp/.
- ?regexp?
- Like m/regexp/
search, but match only once between calls to the reset operator.
- abs(x)
- Return the absolute value of x.
- accept(newSocket,
genericSocket)
- Execute the accept(2) system call. Return the
packed address upon success, the undefined value
otherwise. See also socket,
listen.
- alarm seconds
- Deliver a SIGALRM after seconds-1 seconds, or
cancel scheduled delivery if seconds is 0. Return
the number of seconds remaining on the previously
scheduled timer. See also kill,
%SIG.
- atan2(y, x)
- Return the arctangent of y/x, expressed in
radians in the range [-pi, pi].
- bind(socket, name)
- Execute the bind(2) system call. name must
be a packed address of the proper type for the socket.
Return non-zero if successful, the undefined value
otherwise. See also socket, pack.
- binmode [fileHandle]
- Disable CR/LF sequence translation, if any, for the file
referenced by fileHandle.
- caller [expr]
- Return current subroutine's context as ($package,
$filename, $line). With expr, return
additional info (used by the debugger).
- chdir [expr]
- Change working directory to expr (default is home
directory). Return 1 upon success, 0 otherwise.
- chmod mode, file,
...
- Change permissions of the given list of files to mode
(an integer). Return the number of files successfully
changed. See also stat, chown, utime,
rename.
- chop(lvalueList)
- chop [lvalue]
- Remove the last character from a string (default: $_)
or from each of a list of strings. Return the last
character removed.
- chown uid, gid,
file, ...
- Set the owner and group ID's of the given list of files
to uid and gid, respectively. Return the
number of files changed. See also stat,
chmod, utime,
rename.
- chr(expr)
- Return a string containing the character in the character
set represented by the integer-valued expr. See
also ord.
- chroot [dirName]
- Cause dirName (default $_) to become the
root directory of the filesystem, as perceived by the
current process. A dirName of "/" refers
to the system root. See also chdir.
- close fileHandle
- Close the given file or pipe, reset the line counter ($.),
and, if fileHandle refers to a pipe, wait for the
process to terminate and place the exit status of the
child process into $?. Return non-zero if
successful and the undefined value otherwise. See also open, pipe.
- closedir dirHandle
- Close a directory opened by opendir.
- connect(socket, name)
- Call connect(2). name must be a packed
address of the proper type for the socket. See also socket.
- cos [expr]
- Return the cosine of expr (default $_),
expressed in radians.
- crypt(plainText,
salt)
- Encrypt the string plainText with the two-letter
string salt using the C library function, crypt(3),
and return the result.
- dbmclose assocArray
- Remove the binding between a dbm file and the associative
array, assocArray. DEPRECATED: use untie.
- dbmopen(assocArray,
dbName, mode)
- Bind a dbm or ndbm database, dbName, to the
associative array, assocArray. Create it with the
protections specified by mode (as modified by the
current umask) if the database does not already
exist. DEPRECATED: use tie.
- defined expr
- Return true iff the lvalue expr is currently
defined. See also undef.
- delete $assocArray(key)
- Remove the entry with the given key from the
associative array, assocArray, and return its
value or the undefined value if no such entry was found.
- die list
- Print the string value of list to STDERR,
appending " at script line line\n"
if list does not end in a newline, and exit with
value: ($! ? $! : ($?>>8) ? ($?>>8) :
255). Inside an eval,
assign the string to $@ rather than printing it,
and return the undefined value from the eval. See
also exit, print, warn.
- do block
- Execute block, returning the value of the last
command executed in it. When modified by a loop modifier,
execute block once before testing the loop
condition. See also eval, while,
unless.
- do subroutine [(list)]
- &subroutine [(list)]
- Execute subroutine, passing the arguments given in
list, and return the value of the last expression
evaluated in subroutine.
- do fileName
- Execute the perl commands contained in the file, fileName.
If fileName is a relative pathname and cannot be
found from the current directory, then search for it from
each directory in @INC. See also require.
- dump label
- Cause perl to dump core. If label is given,
arrange to execute the command "goto label"
if restarted after an undump(l), rather than
restarting the script.
- each assocArray
- Iterate over an associative array. Each time executed,
return another element of associative array, assocArray,
as a 2-element array consisting of the element's key and
value, or the null array if all elements have been
returned. Subsequent execution will restart the
iteration. See also keys, values, foreach.
- endgrent
- Call endgrent(3). See also setgrent,
getgrent.
- endhostent
- Call endhostent(3). See also sethostent,
gethostent.
- endnetent
- Call endnetent(3). See also setnetent,
getnetent.
- endprotoent
- Call endprotoent(3). See also setprotoent, getprotoent.
- endpwent
- Call endpwent(3). See also setpwent,
getpwent.
- endservent
- Call endservent(3). See also setservent,
getservent.
- eof [([fileHandle])]
- For the first form, return 1 if fileHandle is at
end-of-file, or unopened, otherwise return 0. If no
arguments are specified, default to the last file read.
If the null list is given, default to the last file in
the command-line series (<>). See also open, close.
- eval [expr]
eval block
- Parse and execute the perl code given by expr
(default $_), or within the block, in the
current program context. Upon success, set $@ to
the null string and return the value of the last
expression evaluated. Fatal errors or execution of the die command cause the
undefined value to be returned and $@ to be set
to the error message. See also do.
- exec [progVar] argv
- Execute the execve(2) system call, transforming
the current process into a new one. The full pathname of
the command to be executed may be given by progVar,
a scalar variable (the first element of argv is
used by default), and the elements of the list, argv,
form its command line. If given a single argument
containing Bourne shell metacharacters, then execute the
command "/bin/sh -c argv"
instead. This command does not return if successful. See
also fork, system.
- exit [expr]
- Exit immediately with the integer value of expr (0 by
default). See also die.
- exp [x]
- Return ex (x
defaults to $_). See also die.
- fcntl(fileHandle,
function, scalar)
- Execute the fcntl(2) system call, if available.
This command requires the fcntl.ph perl library
module. The scalar argument may be used and/or
set, depending on function. Return the undefined
value if the ioctl(2) system call returns -1, the
string "0 but true" if it returns 0, and the
return value itself otherwise. See also ioctl,
flock, syscall.
- fileno fileHandle
- Return the file descriptor for fileHandle. See
also $!, open.
- flock(fileHandle,
operation)
- Execute the flock(2) system call, if available.
See also fcntl, syscall.
- fork
- Execute the fork(2) system call. Return the child
PID in the parent process and 0 in the child process.
Return the undefined value if unsuccessful. See also exec, pipe,
shell.
- getc [fileHandle]
- Return the next character from the file referenced by fileHandle
(STDIN by default), or the null string upon
end-of-file. See also read.
- getlogin
- Return the current login name, as given in /etc/utmp.
If none found, return the null string. See also getpwuid, getpwent,
@ENV.
- getpeername(socket)
- Return the packed sockaddr address of the other end of
the connection, socket. See also getsockname, socket, accept,
bind, unpack.
- getpgrp [pid]
- Return the current process group of the process
identified by pid (or the current process if pid
is 0 or unspecified). See also setpgrp,
getppid, $$.
- getppid
- Returns the process id of the parent process. See also $$.
- getpriority(which,
who)
- Call getpriority(2) to return the current priority
of a process, process group, or user. See also setpriority, $$, $<,
getpgrp.
- getgrent
- getgrgid(gid)
getgrnam(groupName)
- Call the C library routine of the same name. If an
appropriate group entry is found, return the list ($name,
$passwd, $gid, $members) in an array context or the
group name (GID for getgrnam) in a scalar context.
$members is a space-separated list of the login
names belonging to the group. Otherwise, return the null
list or the undefined value, depending on context. See
also setgrent, endgrent.
-
- gethostbyaddr(hostAddr,
addrType)
gethostbyname(hostName)
gethostent
- Call the C library routine of the same name. If
an appropriate host entry is found, return the
list ($name, $aliases, $addrtype, $length,
@addrs) in an array context or the host name
(address for gethostbyname) in a scalar
context. where the @addrs value is the
list of addresses in raw form. In the Internet
domain, unpack them with "($a,$b,$c,$d)
= unpack('C4',$addr[0]);" Upon failure,
return the null list or the undefined value,
depending on context, and return the value of the
h_errno variable in $?, if
supported. See also sethostent,
endhostent.
- getnetbyaddr(netAddr,
addrType)
getnetbyname(netName)
getnetent
- Call the C library routine of the same name. If
an appropriate network entry is found, return the
list ($name, $aliases, $addrtype, $net)
in an array context or the network name (network
address for getnetbyname) in a scalar
context. Otherwise, return the null list or the
undefined value, depending on context. See also setnetent, endnetent, gethostbyaddr, upack.
- getprotobyname(protoName)
- getprotobynumber(number)
getprotoent
- Call the C library routine of the same name. If
an appropriate protocol entry is found, return
the list ($name, $aliases, $proto) in an
array context or the protocol name (protocol
number for getprotobyname) in a scalar
context. Otherwise, return the null list or the
undefined value, depending on context. See also setprotoent, endprotoent.
- getpwent
getpwnam(loginName)
getpwuid(uid)
- Call the C library routine of the same name. If
an appropriate login entry is found, return the
list ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)
in an array context or the login name (UID for getpwnam)
in a scalar context. Otherwise, return the null
list or the undefined value, depending on
context. See also setpwent,
endpwent, getlogin.
- getservbyname(serviceName,
proto)
getservbyport(port,
proto)
getservent
- Call the C library routine of the same name. If
an appropriate service entry is found, return the
list ($name,$aliases,$port,$proto) in an
array context or the service name (service port
for getservbyname) in a scalar context.
Otherwise, return the null list or the undefined
value, depending on context. See also setservent, endservent.
- getsockname(socket)
- Return the packed sockaddr address of the local
end of the connection, socket. See also getpeername, socket, unpack.
- getsockopt(socket,
level, optName)
- Return the socket option requested or undefined
if an error occurs. See also setsockopt, socket.
- gmtime [expr]
- Convert the time as returned by time
(or expr, if given) to an array of the
form: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst).
$mon has the range [0..11] and $wday
has the range [0..6] (Sunday = 0). The values are
computed with respect to Greenwich Mean Time. See
also localtime.
- goto label
- Resume execution at the statement labeled label.
The labelled statement cannot be nested inside a do() construct. See
also if, unless, while, until,
for, "Goto Statement Considered
Harmful," by Edsker Djkstra, CACM.
- grep(expr,
list)
- For each element of list, evaluate expr
in a context in which $_ references the
element, and return either an array consisting of
those elements for which the expression evaluated
to true, or the number of times the expression
was true, depending on context. See also map, foreach.
- hex [expr]
- Return the decimal value of expr (default $_)
interpreted as a number in hexadecimal notation.
See also int, oct.
- index(str,
substr[, position])
- Return x+$[, where x is
the number of characters in str preceeding
the first occurrence, if any, of substr,
beginning at or after its (position - $[
- 1)'th character, and $[ - 1 otherwise.
The default value of position is 0. See
also m/regexp/.
- int [expr]
- Return the value of expr ($_ by
default) interpreted as a decimal integer. See
also hex.
- ioctl(fileHandle,
function, scalar)
- Execute the ioctl(2) system call. This
command requires the ioctl.ph perl
library module. The scalar argument may be
used and/or set, depending on function.
Return the undefined value if the ioctl(2)
system call returns -1, the string "0 but
true" if it returns 0, and the return value
itself otherwise. See also fcntl,
pack, unpack, require.
- join(expr, listOrArray)
- Return the string formed by the concatenation of
the elements of listOrArray, separated by
the string expr. See also split.
- keys assocArray
- Return an array containing all the keys of the
associative array, assocArray, or the
number of keys, depending on context. See also values, each.
- kill sig,
list
- Send signal sig (either an integer or a
quoted signal name) to each of the processes (or
process groups, if sig has a "-"
prefix) whose ID's are given in list. Return the
number of processes successfully signalled. See
also %SIG.
- last [label]
- immediately terminate the innermost enclosing
loop, or the loop labelled by label, if
specified. Any continue block associated with the
loop is not executed. See also next, while, until,
for, foreach.
- length [expr]
- Return the number of characters in expr ($_
by default).
- link(oldfile,
newFile)
- Create a new name, newFile, for the file
referred to by oldFile. Return 1 upon
success, 0 otherwise. See also symlink,
unlink, rename.
- listen(socket,
queueSize)
- Execute the listen(2) system call. See
also socket.
- local(list)
- Create new instantiations of the lvalues in list,
to be used by the innermost enclosing block,
subroutine, eval, or do command, and all
subroutines called within it, and return the
list. The instantiations are destroyed upon exit
from it. See also my.
- localtime [expr]
- Convert the time as returned by time
(or expr, if given) to an array of the
form: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst).
$mon has the range [0..11] and $wday
has the range [0..6] (Sunday = 0). The values are
computed with respect to the local timezone. See
also gmtime.
- log [x]
- Return loge(x).
The value x defaults to $_. See
also exp.
- lstat file
- Equivalent to the stat
command unless file (a filehandle or a
file name) references a symbolic link. In that
case, provide values for the symbolic link
itself, rather than for the object to which it
refers. See also readlink.
- [m]/[regexp]/[{gio}]
- In a scalar context, return 1 and set $1,
$2, etc., and $`, $', $&,
and $+ (see the descriptions for these
variables) iff the variable-interpolated regexp
matches the target string, otherwise return
the undefined value. In an array context, return
the array of substrings matched by subexpressions
in regexp (or (1), if none) iff the
variable-interpolated regexp matches the
target string (no variables are set), otherwise
the null array.
- The default regexp is the last successfully
marched regexp. The target string is $_
unless otherwise specified using the =~ or !~
operator. The initial "m" allows
any non-alphanumeric character to be the pattern
delimiter instead of "/". The
"i" option causes case-insensitive
matching; the "o" option forces
variable-interpolation to be performed only once;
and the "g" option, in a scalar
context, causes iteration through the string on
each successful evaluation, or, in an array
context, it causes the array returned to contain
all substrings matched by the subexpressions in
regexp for all possible matches in the target
string (or all matches if no subexpressions). See
also s/regexp/replacement/,
grep.
- mkdir(dirname,
mode)
- Create directory dirname with permissions
"mode & umask". If
successful return 1, otherwise return 0 and set $!.
See also rmdir, opendir.
- msgctl(id, cmd,
arg)
- Execute the msgctl(2) system call, Return
the undefined value if the system call returns
-1, the string "0 but true" if it
returns 0, and the return value itself otherwise.
See also msgget, msgsnd, msgrcv, pack,
unpack.
- msgget(key,
flags)
- Execute the msgget(2) system call. Return
the message queue ID, or the undefined value on
error. See also msgctl,
msgsnd, msgrcv, pack,
unpack.
- msgsnd(id, msg,
flags)
- Execute the msgsnd(2) system call to send
message msg to message queue id. msg
must begin with a packed, long integer
message type. See also msgctl,
msgget, msgrcv, pack,
unpack.
- msgrcv(id, var,
size, type, flags)
- Execute the msgrcv(2) system call to
receive a message from message queue id into
scalar variable var of maximum size size.
If a message is received, the packed, long
integer message type is the first thing in var,
and the maximum length of var is size plus
the size of the message type. See also msgctl, msgget, msgsnd, pack,
unpack.
- next [label]
- Execute the continue block, if any, associated
with the innermost enclosing loop, or the loop
labelled by label, if specified, and begin
a new iteration of the loop. See also last, continue.
- oct [expr]
- Return the decimal value of expr (default $_)
interpreted as a number in octal notation, or in
hexadecimal notation if it begins with "0x".
See also hex, int.
- open fileHandle[,
expr]
- Open a file whose name is given by expr,
or a pipe to a new process whose command line is
given by expr, and associate it with fileHandle.
expr defaults to $fileHandle. Return
non-zero upon success (the PID of the subprocess,
in the case of a pipe), or the undefined value
otherwise.
- If expr begins with one of "<",
">", ">>",
or "+>", then open the file
given by the remainder of expr with
read-only, write-only, append, or read/write
access, respectively ("<"
by default). An "&"
appearing immediately after each of these
indicates the remainder of expr is a file
descriptor (if numeric) or a file handle. In that
case, dup it and associate fileHandle with
the duped file descriptor.
- For a pipe, expr either starts with a
"|" or ends with one, to
produce a pipe to the subprocess or a pipe frrom
it, respectively. See also read,
write, close, pipe.
- opendir(dirhandle,
expr)
- Open a directory named expr. Returns
non-zero if successful, or the undefined value if
not. See also readdir,
telldir, seekdir, rewinddir, closedir.
- ord [expr]
- Return the numeric ASCII value of the first
character of expr (default: $_).
See also chr, int.
- pack(template,
list)
- Pack an array or list into a binary structure.
Return a string containing the structure. template
is a string consisting of packing code letters
and optional repeat or length specifiers. See
also unpack.
- pipe(readHandle,
writeHandle)
- Open a pair of buffered, connected pipes like the
corresponding system call. See also open, $|.
- pop array
- Return the last value of array, after
removing it from the array, or the undefined
value if array is empty. See also push.
- print [[fileHandle]
list]
- Print the comma-separated list of strings
to the file referenced by fileHandle (the
default is the currently selected output
channel). If list is also omitted, print $_.
Return non-zero if successful. See also printf, write.
- printf [[fileHandle]
list]
- Equivalent to "print
fileHandle sprintf(list)''.
See also sprintf, write.
- push(array, list)
- Push the values of list onto the end of
the array array, increasing the length of array
by the length of list. See also pop.
- q/string/
qq/string/
qw/string/
qx/string/
- Alternate quotation operators: the q
operator is equivalent to enclosing string in
single quotes; the qq operator, double
quotes; the qw operator, list notation;
and the qx operator, backquotes. Any
non-alphanumeric delimiter can be used in place
of "/". Also, if the delimiter is an
opening bracket or parenthesis, the final
delimiter is the corresponding closing
punctuation.
- rand [expr]
- Return a random fractional number between 0 and
the value of expr (expr should be
positive, and defaults to 1). See also srand.
- read(fileHandle,
scalar, length, [offset])
- Read length bytes from fileHandle.
Place the bytes into scalar, beginning at offset
(0 by default). Return the number of bytes
read, or the undefined value upon error. scalar
will be resized to exactly contain the bytes
read. See also write,
sysread.
- readdir dirHandle
- Return the next directory entry (all of the rest
of the entries, in an array context) from the
directory referred to by dirHandle. If
there are no more entries, return the undefined
value (or the null list). See also opendir.
- readlink expr
- Return the value of a symbolic link named by expr
($_ by default). On error, return the
undefined value (setting $! (ERRNO)).
See also lstat, symlink.
- recv(socket, scalar,
len, flags)
- Receive a len-byte message on socket
filehandle socket, placing the message
into scalar, which will be resized to
exactly contain the message. Return the address
of the sender, or the undefined value if there's
an error. Takes the same flags as recv(2).
See also socket, send.
- redo [label]
- Restart the enclosing loop block labelled with label
(the default is the innermost enclosing loop)
without evaluating the conditional again or the continue block, if
any. See also next, last.
- rename(oldName,
newName)
- Change the name of file oldName to newName,
returning 1 if successful, 0 otherwise. This
command cannot rename a file in such a way that
would require the file to change filesystems. See
also link.
- require [expr]
- Execute the file specified by expr ($_
by default) at this point in the current
script, if it hasn't already appeared in a
previous require
statement (using this name). The last
statement evaluated in the file must return
non-zero, or a fatal error is raised. See also use.
- reset [expr]
- Clear all variables in the current package that
begin with the letters referred to by expr,
or reset ?regexp?
search expressions, if expr is omitted. expr
is interpreted as a list of single characters and
character ranges (indicated with hyphens). Only
reset variables or searches in the current
package. Always returns 1.
- return list
- Return list from the current subroutine.
See also sub.
- reverse list
- In an array context, return an array value
consisting of the elements of list in the
opposite order. In a scalar context, return a
string value consisting of the bytes of the first
element of list reversed. See also map.
- rewinddir dirHandle
- Set the current position to the beginning of the
directory for readdir
on dirHandle. See also seekdir, opendir.
- rindex(str,
substr[, position])
- Return the position of the last occurrence of substr
at or before position in str.
See also index, m/regexp/.
- rmdir dirName
- Delete the directory dirName (default: $_),
which must be empty. Return 1 if successful.
Return 0 and set $! (ERRNO) otherwise.
See also unlink, mkdir.
- s/[regexp]/replacement/[flags]
- Replace the string matching regexp (by
default the most recent successfully matched
regular expression) with replacement in
the operand specified by a =~ or !~
operator, or in $_ by default. Return
the number of substitutions made. flags
can be zero or more of: g, indicating that
all occurrences of the pattern are to be
replaced; i, indicating that matching is
case-insensitive; e, to evaluate replacement
as an expression rather than just a
double-quoted string; and o, to cause
evaluation of replacement to occur only
once. Any non-alphanumeric delimiter may replace
the slashes. If single quotes are used, no
interpretation is done on the replacement string
(the e modifier overrides this, however). If
backquotes are used, the actual replacement text
is the output of the command given by replacement.
If regexp is delimited by bracketing
quotes, then replacement has its own pair
of quotes. See also m/regexp/.
- scalar(expr)
- Force expr to be interpreted in a scalar
context and return the resulting value. See also int, join,
wantarray.
- seek(fileHandle,
position, whence)
- Position the file pointer for fileHandle
to the position'th byte from the beginning
of the file if whence is 0, from the
current file pointer position if whence is
1, and from the end of the file if whence
is 2. Return 1 if successful, 0 otherwise.
See also tell, open, seekdir.
- seekdir(dirHandle,
pos)
- Set the current position for the readdir routine on dirHandle
to pos. pos must be a value
returned by telldir.
See also opendir, seek.
- select [(fileHandle)]
- Set the current default output fileHandle to fileHandle,
and return the previously selected fileHandle.
See also write, print, $",
$|.
- select(rmask,
wmask, emask, timeout)
- Suspend execution of the current process until
I/O or exceptional conditions exist on the file
descriptors specified by the file descriptor
masks, rmask, wmask, and emask.
Wait at most timeout seconds, or forever
if timeout is undef. Return the time left
to wait (on most implementations, otherwise timeout).
See also select(2), vec,
fileno, time, sleep.
- semctl(id, semNum,
cmd, arg)
- Call the System V IPC function semctl(2).
If cmd is &IPC_STAT or &GETALL,
then arg must be a variable which will
hold the returned semid_ds structure or
semaphore value array. Return the undefined value
for error, "0 but true" for zero, or
the actual return value otherwise. See also semget,.semop.
- semget(key,
nsems, size, flags)
- Calls the System V IPC function semget(2).
Returns the semaphore id, or the undefined value
on error. See also semctl,
semop.
- semop(key,
opstring)
- Calls the System V IPC function semop(2)
to perform semaphore operations such as signaling
and waiting. optstring must be a packed
array of semop structures. Return non-zero if
successful, or the undefined value on error. See
also semctl, semget.
- send(socket,
msg, flags[, to])
- Send a message an a socket. Takes the same flags
as send(2). On unconnected sockets you
must specify a destination to send to.
Return the number of characters sent, or the
undefined value on error. See also recv, socket.
- setgrent
- sethostent(stayOpen)
setnetent(stayOpen)
- Call the C library routine of the same name. See
also getgrent, gethostent, getnetent.
- setpgrp(pid,
pgrp)
- Set the current process group for the specified
pid (default: 0, for the current process).
Produce a fatal error if used on a machine that
doesn't implement setpgrp(2). See also setpgp.
- setpriority(which,
who,priority)
- Set the priority for a process, process group, or
user. See also getpriority.
- setprotoent(stayOpen)
- setpwent
- setservent(stayOpen)
- Call the C library routine of the same name. See
also setprotoent(3), setpwent(3), setservent(3),
getprotoent, getpwent, getservent.
- setsockopt(socket,
level, optName, optVal)
- Set the socket option requested. Returns
undefined if there is an error. optVal may
be specified as undef
if you don't want to pass an argument.
- shift [array]
- Removes the first element from array
(defaults to @ARGV at top-level, @_
in subroutines) and returns it, shortening the
array by 1. Returns the undefined value if the
array is empty. See also unshift,
push, pop.
- shmctl(id, cmd,
arg)
- Call shmctl(2). If cmd is &IPC_STAT,
then arg must be a variable which will
hold the returned shmid_ds structure.
Return the undefined value upon error, "0
but true" for zero, or the actual
return value otherwise. See also shmget.
- shmget(key,
size, flags)
- Call shmget(2). Return the shared memory
segment id, or the undefined value upon error.
See also shmread,
shmwrite, shmutil.
- shmread(id,
var, pos, size)
- Read size bytes into var, starting
from the pos'th byte of shared memory
segment id by attaching to it, copying
out, and detaching from it. Return true if
successful, false upon error. See also shmwrite, shmget.
- shmwrite(id,
string, pos, size)
- Write the first size bytes of string
into shared memory segment id, starting at
the pos'th byte of id by attaching
to it, copying in, and detaching from it. If string
is too short, nulls are written to fill out size
bytes. Return true if successful, false upon
error. See also shmread,
shmget.
- shutdown(socket,
how)
- Shut down a socket connection in the manner
indicated by how, which has the same
interpretation as shutdown(2). See also socket.
- sin [expr]
- Return the sine of expr (default is $_),
in radians. See also cos.
- sleep [expr]
- Sleep for expr seconds
(default: until the next signal). Return the
number of seconds actually slept. See also time, select.
- socket(socket,
domain, type, protocol)
- Open a socket of the specified type and
attach it to filehandle socket. domain,
type, and protocol are specified
the same as for socket(2). Return true if
successful, false otherwise. See also accept, bind,
connect, getpeername, getsockame, getsockopt, listen, recv,
send, setsockopt, shutdown, socketpair.
- socketpair(sock1,
sock2, domain, type,
protocol)
- Create an unnamed pair of sockets in the
specified domain, of the specified type. domain,
type, and protocol are specified
the same as for the system call of the same name.
Returns true if successful, false otherwise. See
also pipe.
- sort [subroutine]
list
- Sort list using subroutine as the
comparison function (ascending lexicographic
comparison, by default) and return the sorted
array value. subroutine may be the name of
a non-recursive subroutine that returns a
negative integer if the value referenced by the
predefined value, $a, is ordered before that
referenced by $b, a positive integer if after,
and 0 otherwise. subroutine may also be a
scalar variable whose value names such a
subroutine, or a block. See also <=>,
cmp.
- splice(array,
offset, [length, [list]])
- Remove the elements designated by offset
and length from array, and replace
them with the elements of list, if any.
Return the elements removed. If length is
omitted, remove everything from offset onward.
See also split, join.
- split [(/regExp/,
[expr[, limit]])]
- Split expr ($_ by default) into
an array consisting of the first limit
(the default is no limit) strings in expr
separated by strings matching regExp
(default /[ \t\n]+/). In an array
context, return the array. In a scalar context,
set @_ to the array and return the
number of fields found. If the regExp contains
parentheses, additional array elements are
created from each matching substring in the
delimiter. See also join.
- sprintf(format,
list)
- Return a string formatted by the usual printf conventions.
(The '*' character is not supported).
- sqrt [expr]
- Return the square root of expr (default is
$_).
- srand [expr]
- Set the seed for the random number generator used
by rand to expr
(default: time).
- stat fileHandle
stat expr
- Return the array ($dev, $ino, $mode, $nlink,
$uid, $gid, $rdev, $size, $atime, $mtime, $ctime,
$blksize, $blocks) for the file referenced
by fileHandle, or named by expr.
return the values from the last stat or
filetest if fileHandle is an underline.
Return the null list upon error. See also lstat, open.
- study scalar
- Preprocess scalar ($_ by default),
optimizing internal pattern-matching mechanisms
for performing pattern matching on it. See also m/regExp/,
s/regExp/replacement/.
- substr(expr,
offset[, len])
- Return the len-character substring of expr
beginning at offset. A negative offset
indicates a position relative to the end of the
string. If len is omitted, return
everything up to the end of the string. If expr
is an lvalue, the entire substr may
function as an lvalue. See also index,
m/regExp/,
s/regExp/replacement/.
- symlink(oldFile,
newFile)
- Create a symbolic link, newFile, with
contents oldFile. Return 1 upon success, 0
otherwise. See also link,
open, lstat.
- syscall list
- Call the system call whose index is the first
element of the list, passing it the remaining
elements as arguments. See also sysread, syswrite, stat, fork,
exec, system.
- sysread(fileHandle,
scalar, length[, offset])
- Read length bytes from fileHandle using
read(2). Place the data into scalar,
beginning at offset. Return the number of
bytes actually read, or undef
upon error. See also read,
syswrite, syscall, open.
- system list
- Fork a child process, executing "exec list" in
the child. Wait for the child process to
complete, returning its exit status as returned
by wait(2). See also fork.
- syswrite(fileHandle,
scalar, length[, offset])
- Write length bytes from scalar,
beginning at offset, to fileHandle,
using write(2). Return the number of bytes
actually written, or undef
upon error. See also print,
write, sysread,
syscall, open.
- tell [fileHandle]
- Return the current file position for fileHandle
(default is the file last read). See also seek, open,
telldir.
- telldir dirHandle
- Return the current directory position for dirHandle.
See also seekdir, opendir, tell.
- tie variable, packageName,
list
- Bind variable to package packageName,
which provides the implementation for the
variable. Pass list to the "new"
method of the package. See also untie.
- time
- Return the number of non-leap seconds since
00:00:00 UTC, January 1, 1970. See also gmtime, localtime.
- times
- Return a four-element array,
($user,$system,$cuser,$csystem), giving the user
and system times, in seconds, for this process
and its children. See also fork.
- tr/searchList/replacementList/[{cds}]
- y/searchList/replacementList/[{cds}]
- Translate all occurrences of the characters found
in the search list with the corresponding
character in the replacement list. Return the
number of characters replaced or deleted. If no
string is specified via the =~ or !~ operator,
the $_ string is translated. Modifiers are: c
- complement the character set searchList;
d - delete characters in searchList not
found in replacementList; s -
replace sequences of characters translated to the
same character to a single instance of the
character. If replacementList is shorter
than searchList and the d modifier
is not present, the replacementList is
padded with its final character to increase its
length to that of searchList. replacementList
may be null, in which case searchList is
used as its value. See also substr,
m//.
- truncate(fileHandle,
length)
- truncate(expr, length)
- Truncate the file referenced by fileHandle,
or named by expr, to length.
- umask [expr]
- Set the umask for the process to expr (a
numeric value) and return its previous value. If expr
is omitted, return the current umask. See
also chdir, open, mkdir.
- undef [expr]
- Undefine the value of the lvalue, expr, if
any, which may be a scalar value, an array, or a
subroutine name (prefixed with &). Always
return the undefined value. See also delete.
- unlink list
- Delete a list of files and return the number of
files successfully deleted. See also rmdir.
- unpack(template,
expr)
- Expand the string expr into an array value
as directed by template. Return the array,
or the first value of the array in a scalar
context. template has the same format as
for pack. In addition,
a prefix of "%<number>"
(default 16) indicates a <number>-bit
checksum of the items instead of the items
themselves. Default is a 16-bit checksum. See
also vec.
- untie variable
- Break the binding between variable and its
package. See tie.
- unshift(array,
list)
- Prepend list to the front of array,
and return the number of elements in the
resulting array. See also shift,
push.
- utime list
- Change the access and modification times on each
file of a list of files. The first two elements
of list must be the numerical access and
modification times. Return the number of files
successfully changed. See also open.
- values assocArray
- Return an array containing the values in assocArray,
or, in a scalar context, the number of values.
See also keys,
each.
- vec(expr, offset,
bits)
- Treating string expr as a vector of
unsigned integers, return the bits
bit-wide value starting at offset. May
also be assigned to. bits must be a power
of two from 1 to 32.
- wait
- Wait for a child process to terminate. Return the
PID of the deceased process, or -1 if there are
no child processes. The child's termination
status is returned in $?. See also fork, waitpid.
- waitpid(pid,
flags)
- Wait for a particular child process to terminate.
Returns the PID of the deceased process, or -1 if
there is no such child process. The child's
termination status is returned in $?.
Valid values for flags are
system-dependent. See also fork,
wait.
- wantarray
- Return true if the current subroutine is being
evaluated in an array context. Return false in a
scalar context. See also scalar.
- warn list
- Print the string value of list to STDERR,
appending "at script
line line\n" if list
does not end in a newline. See also die, print.
- write [(fileHandle)]
- write()
- Write a formatted record to the specified file,
using the format associated with that file. By
default the format for a file is the one having
the same name is the filehandle, but the format
for the current output channel (see select) may be set
explicitly by assigning the name of the format to
the $~ variable.
- Top of form processing is handled automatically:
if there is insufficient room on the current page
for the formatted record, the page is advanced by
writing a form feed, a special top-of-page format
is used to format the new page header, and then
the record is written. By default the top-of-page
format is the name of the filehandle with
"_TOP" appended, but it may be
dynamically set to the format of your choice by
assigning the name to the $^ variable while the
filehandle is selected. The number of lines
remaining on the current page is in variable $-,
which can be set to 0 to force a new page.
- If fileHandle is unspecified, output goes
to the current default output channel, which
starts out as STDOUT but may be changed by the select operator.
If the is an expr, then the expression is
evaluated and the resulting string is used to
look up the name of the fileHandle at run
time. See also print.
|