perl 的一些默认变量
时间:2010-02-25 来源:PHP爱好者
| Predefined Variables | Perl provides a large number of predefined variables. The following is a list of some common predefined variables: | |
| $_ | The default input and pattern-searching space. | |
| $. | Current line number for the last filehandle accessed. | |
| $@ | The Perl syntax error message from the last eval() operator. | |
| $! | Yields the current value of the error message, used with die. | |
| $0 | Contains the name of the program being executed. | |
| $$ | The process number of the Perl running this script. | |
| $PERL_VERSION / $^V | The revision, version, and subversion of the Perl interpreter. | |
| @ARGV | Contains the command-line arguments. | |
| ARGV | A special filehandle that iterates over command-line filenames in @ARGV. | |
| @INC | Search path for libarary files. | |
| @_ | Within a subroutine the array @_ contains the parameters passed to that subroutine. | |
| %ENV | The hash %ENV contains your current environment. | |
| %SIG | The hash %SIG contains signal handlers for signals. |
相关阅读 更多 +










