Special Variables
The alternative names for special variables are provided by the standard module English.
The following variables are global and should be localized in subroutines:
$_Alternative:
$ARG.The default argument for many functions and operations.
$.Alternatives:
$INPUT_LINE_NUMBER, $NR.The current input line number of the last filehandle that was read. Reset only when the filehandle is closed explicitly.
$/Alternatives:
$INPUT_RECORD_SEPARATOR, $RS.The string that separates input records. Default value is a newline.
$,Alternatives:
$OUTPUT_FIELD_SEPARATOR, $OFS.The output field separator for the print functions. Default value is an empty string.
$"Alternative:
$LIST_SEPARATOR.The separator that joins elements of arrays interpolated in strings. Default value is a single space.
$\Alternatives:
$OUTPUT_RECORD_SEPARATOR, $ORS.The output record separator for the print functions. Default value is an empty string.
$?Alternative:
$CHILD_ERROR.The status returned by the last
` . . . `command, pipe close, wait, waitpid, or system function.$]The Perl version number, e.g.,
5.006.See also$^Vin page 72.$[The index of the first element in an array or list, and of the first character in a substring. Default is zero. Deprecated. Do not use.
$;Alternatives:
$SUBSCRIPT_SEPARATOR, $SUBSEP.The subscript separator for multidimensional hash emulation. Default is
"\034".$!Alternatives:
$OS_ERROR, $ERRNO.If used in numeric context, yields the current value of
errno.Otherwise, yields the corresponding ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access