Network Programming with Perl By Lincoln D. Stein Slots : 1
Table of Contents
Appendix B. Perl Error Codes and Special Variables
Content
Other Perl Globals
Table B.3 lists other Perl globals used in the body of this book. The first column is the Perl punctuation variable, and the second is its English-language equivalent when the English module is loaded.
Table B.3. Other Perl Globals
Variable
English
Description
$?
$CHILD_ERROR
Status returned by the last pipe close, backtick, or successful call to wait() ; a status of 0 generally indicates that the child terminated without error
$!
$ERRNO
Error message from the last failed system call
$^E
$EXTENDED_OS_ERROR
Extended error information from non-UNIX operating systems
$<digit>
Last matched subexpression from a successful pattern match (e.g., $1 , $2 )
$&
$MATCH
Entire string matched by the last successful pattern match
$`
$PREMATCH
String preceding whatever matched the last successful pattern match
$'
$POSTMATCH
String following whatever matched the last successful pattern match
$$
$PID
Process ID of the current process
$<
$UID
Real user ID (UID) of the current process
$>
$EUID
Effective UID of the current process; corresponds to the effective privileges that a set- userid script runs under
$(
$GID
Real group ID (GID) of the current process
$)
$EGID
Effective GID of the current process; corresponds to the effective privileges that a set-groupid script runs under
$0
$PROGRAM_NAME
Name of the script being run
$ARGV
Name of the current file when reading from <>
@ARGV
Array of command-line arguments
@INC
List of packages that the current script or module inherits from when using Perl's object-oriented features
@_
Within a subroutine, the array containing the arguments passed to the subroutine
%ENV
A hash containing the current environment variables
%SIG
A hash containing the names of signals to be caught and the handlers to invoke when they arrive