Perl Cheat Sheet Page 20

ADVERTISEMENT

y
chroot FILENAME
Changes the root directory for the process and its children.
[
]
die
LIST
Prints the value of
to STDERR and exits with the current value of $!
LIST
(errno). If $! is 0, exits with the value of ($? >> 8) . If ($? >> 8) is
0, exits with 255.
defaults to "Died" .
LIST
Inside an
eval
, the error message is put into $@ , and the
eval
is terminated
with undef; this makes
the way to raise an exception.
die
exec LIST
Executes the system command in
; does not return.
LIST
exit
[
EXPR
]
Exits immediately with the value of EXPR , which defaults to 0 (zero). Calls
END routines and object destructors before exiting.
fork
Does a fork(2) system call. Returns the process ID of the child to the parent
process and zero to the child process.
getlogin
Returns the current login name as known by the system. If it returns false,
use
getpwuid
.
[
]
getpgrp
PID
Returns the process group for process
(0, or omitted, means the current
PID
process).
getppid
Returns the process ID of the parent process.
getpriority WHICH, WHO
Returns the current priority for a process, process group, or user.
y
glob PAT
Returns a list of filenames that match the shell pattern
PAT
.
kill LIST
Sends a signal to a list of processes. The first element of the list must be the
signal to send (either numeric, or its name as a string). Negative signals kill
process groups instead of processes.
setpgrp PID, PGRP
Sets the process group for the
(0 indicates the current process).
PID
setpriority WHICH, WHO, PRIO
Sets the current priority for a process, process group, or a user.
sleep
[
EXPR
]
Causes the program to sleep for
EXPR
seconds, or forever if no
EXPR
.
Returns the number of seconds actually slept.
syscall LIST
Calls the system call specified in the first element of the list, passing the rest
of the list as arguments to the call.
system LIST
Does exactly the same thing as
except that a fork is done first,
exec LIST
and the parent process waits for the child process to complete. Returns the
exit status of the child process.
times
Returns a 4-element array (0: $ user, 1: $ system, 2: $ cuser, 3: $ csystem)
giving the user and system times, in seconds, for this process and the
children of this process.
20

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education