D.4. Standard Variables
The following tables detail the various standard variables in the Perl language.
D.4.1. Global Variables
Variable | Use |
---|---|
$_ | The default input and pattern-searching space. |
$. | The current input line number of the last filehandle read. |
$/ | The input record separator (newline is the default). |
$, | The output field separator for the print operator. |
$" | The separator joining elements of arrays interpolated in strings. |
$\ | The output record separator for the print operator. |
$? | The status returned by the last `. . .` command, pipe close, or system operator. |
$] | The Perl version number. |
$; | The subscript separator for multidimensional array emulation (default is \034). |
$! | In a numeric context, is the current value of errno. In a string context, is the corresponding error string. |
$@ | The Perl error message from the last eval or do command. |
$: | The set of characters after which a string may be broken to fill continuation fields in a format. |
$0 | The name of the file containing the Perl script being executed. |
$$ | The process ID of the currently executing Perl program. |
$< | The real user ID of the current process. |
$> | The effective user ID of the current process. |
$( | The real group ID of the current process. |
$) | The effective group ID of the current process. |
$^A | The accumulator for formline and write operations. |
$^D | The debug flags; passed to Perl using the -D command line argument. |
$^F | The highest system file descriptor. |
$^I | In-place edit extension, passed to Perl using the -i command line argument. |
$^L | Formfeed character used in ... |
Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.