[File Handle]
$| If non-zero, force clear the buffer after performing a write or print operation on the currently selected file.
$% The current page number of the currently selected file handle
$= The current page length of the currently selected file handle
$- The remaining length of the page currently selected file handle
$~ The report format name of the currently selected file handle
$^ The current header format name of the currently selected file handle
[Global variables]
$_ Default input and mode search space
$@ Error message generated by the previous eval, do or require function
$/ Input record separator, default to newline character (similar to RS in awk)
$\ Print the input record separator of the function. No newline characters are printed unless $\="\n" is set
$# The digital output format printed using the print function (similar to OMFT in awk)
$? The previous closed pipeline, commands in backticks, and the return status of the system function
$! Return an error number or error string according to the context content.
$$ The Perl program process ID that runs this script
The default value of $* is 0. If 1, it means that multiple lines are matched in the string; 0 means that only matches in a single line
$, Print the output field separator of the function. Generally, the delimiter is not printed in comma-separated strings unless $,=" " is set
$" is similar to $, but it provides printed arrays in double quotes, with default values being spaces
$0 Perl script name
$[ Index to the first character of an array or substring, the default value is 0
$] Print out the first part of the string when using the Perl - v command to obtain version information
$; Subscript separator for multi-dimensional arrays. Default is \034 (similar to awk's SUBSEP)
$. Read the current input line number of the previous file handle; the line number must be reset to the next file handle after closing the previous file handle.
$< The actual uid of the process
$> The valid uid of the process
$( The actual gid of the process
$) The valid gid of the process
$: character set, break the string after it, and fill in consecutive lines in some format (starting from ^). By default, separated by whitespace characters, newlines, or colons \n-
$^A Accumulator for formline and write operations
$^C Returns TRUE if Perl runs in compile-only mode using the -c option
$^D Use the -D switch to turn on the Perl debugging mark
$^E Error information related to the operating system
$^F The maximum number of file descriptors passed to the subroutine, usually 2
$^H The current status of syntax check
$^I When using the -i switch, edit the current value of the extension in situ
$^L paper feeding symbol, used in format
$^M Emergency memory pool
$^O Operating system name
$^P Internal Perl debugging tags
$^S Perl interpreter status
$^T Script execution time. Used for the -A, -C, and -M test operators, which can be set to any numeric value returned by time, perform file tests related to the current time
$^V Perl version
$^W The current setting of the warning switch
$^X The full path name of Perl call
_ Unscore, responsible for testing the special identifier of the file when declaring it
ARGV Special file handle array for line parameter loops
$ARGV When reading from <ARGV>, a variable containing the current file name
@ARGV Array with command line parameters
DATA A special file handle variable responsible for citing the contents after the _END_ flag
@F When using the -a switch, the array obtained by automatically splitting the input line
@INC An array containing file name paths, the require and do functions search for the file name path to be imported
%INC A associative array containing file name paths, from which the require and do functions will search for the file name path to be imported. where the key is the file name and the value is the file path location
%ENV Associated array containing the current environment variable
@EXPORT Default symbols when exporting
@EXPORT_OK Symbols exported according to user requests
%EXPORT_TAGS is used in , responsible for unified naming of symbol sets
%SIG Association array used to set signal processing routines
STDERR Special file handle for standard error content
STDIN Special file handle for standard input
STDOUT Special file handle for standard output content
$-[0] and $+[0] represent the starting and ending positions of the currently matched regular expression in the string being matched
[Local variables within blocks]
$1..$9 contains a corresponding set of parentheses sub-memory patterns. (equivalent to \1..\9)
$& The string that last matched the pattern (equivalent to the sed editor)
$` The leading string of the item that last matched the pattern
$' The string after the last item matching the pattern
$+ The last mode matching the search pattern
@_ Argument list passed to subroutine
Attachment: Another summary
1. Regular expression special variables:
1. $n: Contains the nth substring of the last pattern match
2. $&: The string that was successfully matched in the previous pattern
3. $`: Content before the substring that was successfully matched the last time
4. $': Content after the previous successful substring match
5. $+: The string matching the pattern used in brackets the previous time.
2. Special variables for file handles:
1. $|: If set to zero, after each call to the function write or print, the function flush is automatically called to write the written content back to the file.
2. $%: Current output page number
3. $=: Current length per page
4. $-: The number of rows remaining on the current page
5. $~: The name of the current report output format. The default value is the file handle name.
6. $^: The name of the current report output header format. The default value is the file handle name with the suffix "_TOP".
3. Global special variables:
1. $_ and $ARG: The default input and pattern matching content. If the variable that receives input or the string that performs pattern matching is not specified
2. $. and $NR: the current line number of the file handle that was read for the previous time
3. $/ and $RS: Enter the record separator, which is a new line character by default. If you use the undef variable, you will read to the end of the file.
4. $OFS of $: output domain separator.
5. $\ and $ORS: Output record separator
6. $: :Break line character, default is "\n-" three characters
7. $!: The numeric value of this variable is the value of errno, and the string value is the corresponding system error string
8. $@: Error message for command eval. If empty, it means that the last eval command was executed successfully.
9. $$: The process number of the current Perl script program
10. $<:The actual user number of the current process
11. $>: The valid user number of the current process
12. $(: The actual group user number of the current process
13.$): The valid group user number of the current process
14. $[:The subscript of the first element of the array is 0 by default
15. $]:Perl version number
16. $ARGV: When using "< >" to read the file, save the current file name
4. Global special array variables:
1. @ARGV: Save command line parameters
2. @INC: Save the directory to find Perl program
3. @_: In the subroutine, this array variable contains parameters passed to the subroutine
4. %INC: Hash table %INC contains all files contained in do or require statements. The keyword is the file name and the value is the path to this file.
5. %ENV: Contains the current environment variable
5. Global special file handle
1. ARGV: Special file handles that traverse all file names in array variable @ARGV
2. STDERR: Standard error output handle
3. STDIN: Standard input handle
4. STDOUT: Standard output handle
PERL built-in variables:
$- The number of lines that can be printed on the current page, which is part of the Perl format system
$! Returns an error number or error string according to the context content
$" list separator
$# The default digital output format when printing numbers
$$ Process ID of Perl interpreter
$% Current page number of the current output channel
$& string matching the previous format
$( group ID of the current process
$) Valid group ID of the current process
$* Setting 1 means processing multi-line format. Now it is mostly replaced by the /s and /m modifiers.
$, current output field separator
$. The current input line number of the last read file
$/ The current input record separator is the new line by default
$: character setting, after which the string will be separated to fill in consecutive fields.
$; Delimiter used when simulating multidimensional arrays.
$? Returns the status of the previous external command
$@ Error message returned by Perl interpreter from eval statement
$[ Index number of the first element in the array
$ The delimiter for the current output record
$] The subversion number of the Perl interpreter
$^ The output format name of the top page of the current channel
$^A Variable used to save formatted data before printing
$^D The value of the debug flag
$^E OS extension error message in non-UNIX environments
$^F The maximum file bundling value
$^H Syntax check status activated by the compiler
$^I The value of the built-in control editor
$^L The paper-travelling character sent to the output channel
$^M Size of spare memory pool
$^O Operating system name
$^P Specifies the internal variable of the current debug value
$^R The last evaluation result of the regular expression block
$^S Current interpreter status
$^T Starting from the new century, the steps are calculated in seconds.
$^W Current value of the warning switch
$^X Name of Perl binary executable code
$_ Default input/output and format matching space
$| Controls buffering of the currently selected output file handle
$~ Name of the current report format
$` string before the previous format match information
$' string after matching information in the previous format
$+ The last bracket that matches the previous regular expression search format
$< The real ID of the user currently executing the interpreter
$ contains the result of brackets corresponding to the previous matching regular expression
$= The number of printable lines on the current page
$> The valid user ID of the current process
$0 contains the file name of the executing script
$ARGV The current file name when read from the default file handle
%ENV environment variable list
%INC list of files contained by do or require
%SIG signal list and how to process it
@_ List of parameters passed to subroutine
@ARGV Command line parameter list passed to script
@INC List of directories to search when importing modules
$-[0] and $+[0] represent the starting and ending positions of the currently matched regular expression in the string being matched.