Chinaunix首页 | 论坛 | 博客
  • 博客访问: 326351
  • 博文数量: 88
  • 博客积分: 2051
  • 博客等级: 大尉
  • 技术积分: 950
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-14 23:59
文章分类

全部博文(88)

文章存档

2012年(3)

2011年(2)

2010年(9)

2009年(14)

2008年(60)

我的朋友

分类:

2009-03-06 15:32:03

从Perl by Example捡过来的
 
$_ 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.

 

$| If nonzero, forces buffer flush after every write and print on the currently selected filehandle
$% Current page number of currently selected filehandle
$= Current page length of currently selected filehandle
$– Number of lines left on the page for currently selected filehandle
$~ Name of current report format for currently selected filehandle
$^ Name of current top-of-page format for currently selected filehandle

 

$1.. $9 Contains remembered subpatterns that reference a corresponding set of parentheses (same as \1..\9)
$ & The string matched by the last pattern match (like sed editor)
$' The string preceding what was matched in the last pattern match
$' The string that follows whatever was matched by the last pattern match
$+ The last pattern matched by the last search pattern

 

$_ Default input and pattern-searching space.
$. Current input line number of last filehandle that was read; must close the filehandle to reset line numbers for next filehandle.
$/ Input record separator, newline by default. (Like RS in awk.)
$\ Output record separator for the print function. Does not print a newline unless set: $\="\n"
$, Output field separator for the print function. Normally delimiter is not printed between comma-separated strings unless set: S,=" ".
$" Same as $ but applies to printing arrays when in double quotes. Default is space.
$# Output format for numbers printed with the print function. (Like OMFT in awk.)
$$ The process ID number of the Perl program running this script.
$? Status returned by last pipe closed, command in backquotes, or system function.
$* Default is 0. If set to 1, does a multiline match within a string; 0 for a match within a single line.
$0 Name of this Perl script.
$[ Index of first element of an array, and first character in a substring. Default is 0.
$] The first part of the string is printed out when using perl -v for version information.
$; The subscript separator for multidimensional array emulation. Default is \034. (Like SUBSEP in awk.)
$! Yields the current value of errno (system error number) if numeric, and the corresponding system error string.
$@ Error message from the last eval, do, or require function.
$< The real uid of this process.
$> The effective uid of this process.
$( The real gid of this process.
$) The effective gid of this process.
$: The set of characters after which a string may be broken to fill continuation lines (starting with ^) in a format. Default is \n- to break on whitespace, newline, or colon.
$^A The accumulator for formline and write operations.
$^C TRUE if Perl is run in compile-only mode using command-line option -c.
$^D Perl's debug flags when -D switch is used.
$^E Operating-system-dependent error information.
$^F Maximum file descriptor passed to subprocess, usually 2.
$^H The current state of syntax checks.
$^I Current value of inplace-edit extension when -i switch is used. Use undef to disable inplace editing.
$^L Form feed character used in formats.
$^M Emergency memory pool.
$^O Name of the operating system.
$^P Internal Perl debugging flag.
$^S State of the Perl interpreter.
$^T Time of day when script started execution. Used by -A, -C, and -M test operators and can be set to any number value returned by time to perform file tests relative to the current time.
$^V The Perl version.
$^W The current value of the warning switch.
$^X The full pathname by which this Perl was invoked.
_ An underscore. The special designator for file testing when stating files.
ARGV The special filehandle array for looping over line arguments.
$ARGV The variable containing the name of the current file when reading from .
@ARGV The array containing command-line arguments.
DATA Special filehandle referring to anything following _ _END_ _.
@F The array into which input lines are autosplit when the -a switch is used.
@INC Array containing pathnames where require and do functions look for files that are to be included in this script.
%INC Associative array containing entries for files that have been included by calling do or require. The key is the filename and the value is its location.
%ENV Associative array containing the current environment.
@EXPORT Default symbols to be exported.
@EXPORT_OK Symbols to be exported upon request by the user.
%EXPORT_TAGS Used by Exporter.pm to collectively name sets of symbols.
%SIG Associative array used to set signal handlers.
STDERR Special filehandle for standard error.
STDIN Special filehandle for standard input.
STDOUT Special filehandle for standard output.

 

$#array - 得到array最后一个下标索引值,给其赋值可能会truncate数组

 

 

阅读(1106) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~