Mega Code Archive

 
Categories / Perl / Language Basics
 

Perls special variables

VARIABLE    DEFAULT VALUE    DESCRIPTION $_          N/A              The default input and pattern-searching space. $digit      N/A              Contains the subpattern from a successful parentheses pattern match. $&          N/A              The string from the last successful pattern match. $æ          N/A              The preceding string to the last successful pattern match. $'          N/A              The string following the last successful pattern match. $+          N/A              The last bracket matched from the last search pattern. $*          0                Controls internal string multiline pattern matching. $.          N/A              The current input line number of last filehandle read. $/          \n               The input record separator. $|          0                If set to nonzero, forces a flush of the currently selected stream after every write. $,          N/A              The output field separator for the print command. $"          Space            The separator that joins elements of arrays interpolated in strings. $\          N/A              The output record separator for the print command. $;          \034             The subscript separator for multidimensional array emulation.  $#          N/A              The output format for printed numbers. $%          N/A              The page number of the currently selected output stream. $=          60               The page length of the currently selected output stream. $–          N/A              The number of lines left on the current page. $Ëœ          filehandle       The name of the current top of page format for the currently selected output stream. $:          \n-              The characters used to fill a continuation field. $ËœL         \f               The default form-feed character. $?          N/A              The status value returned from the last system, pipe close, or back tick command. $!          N/A              Contains the current value of errno. $@          N/A              The Perl syntax error from the last eval statement. $$          N/A              The process ID (PID) of the current running Perl script. $<          N/A              The real user ID (UID) of the current running process. $>          N/A              The effective UID of the current running process. $(          N/A              The real group ID (GID) of the current running process. $)          N/A              The effective GID of the current running process. $0          N/A              The name of the file of the Perl script. $[          0                The index of the first element of an array.  $]          N/A              The string printed out when Perl is run with the -v command line option. $ËœA         N/A              The accumulator for form line and write operations. $ËœD         N/A              The current value of the debugging flags. $ËœF         2                The maximum number of system file descriptors. $ËœI         N/A              Contains the current value of the in-place editing flag (-i). $ËœP         N/A              Internal debugging flag. $ËœT         N/A              The time in which the script began running.  $ËœW         N/A              The current value of the warning switch. $ËœX         N/A              The name of the Perl binary that was executed. $ARGV       N/A              The name of the current file when reading from <>.