perl 实例 4th Edition 笔记。
时间:2010-06-23 来源:starB6
第一章:
1: 查看某个函数的用法:
perldoc -f localtime 2: htlm 文件的perl. 很全很详细。
C:\Perl\html\index.html
3:词典:
1: syntax [sintAks] 语法
****************************************
第二章:
1: 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. 2: Operators Perl Assignment =, +=, -=, *= , %=, ^=, &=, |=, .=
Numeric equality = =, !=, <=>
String equality eq, ne, cmp
Relational numeric > >= < <=
Relational string gt, ge, lt, le
Range 5 .. 10 # range between 5 and 10, increment by 1
Logical &&, and, ||, or, XOR, xor, !
Autoincrement/decrement ++ --
File -r, -w, -x,-o, -e, -z, -s, -f, -d, -l, etc.
Bitwise ~ & | ^ << >>
String concatenation .
String repetition x
Arithmetic * / - + %
Pattern matching =~, !~
3: 词典: Perl comments are preceded by a # sign
backslash sequences (\n, \t, \", 反斜杠...
**************************************
第三章: Perl scripts
1: 找到 perl interpreter 的位置:(也就是程序开头 shbang line 后面要写的内容: #! /usr/bin/perl )
which perl
(or : find / -name '*perl' -print;
2:
1: 查看某个函数的用法:
perldoc -f localtime 2: htlm 文件的perl. 很全很详细。
C:\Perl\html\index.html
3:词典:
1: syntax [sintAks] 语法
****************************************
第二章:
1: 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. 2: Operators Perl Assignment =, +=, -=, *= , %=, ^=, &=, |=, .=
Numeric equality = =, !=, <=>
String equality eq, ne, cmp
Relational numeric > >= < <=
Relational string gt, ge, lt, le
Range 5 .. 10 # range between 5 and 10, increment by 1
Logical &&, and, ||, or, XOR, xor, !
Autoincrement/decrement ++ --
File -r, -w, -x,-o, -e, -z, -s, -f, -d, -l, etc.
Bitwise ~ & | ^ << >>
String concatenation .
String repetition x
Arithmetic * / - + %
Pattern matching =~, !~
3: 词典: Perl comments are preceded by a # sign
backslash sequences (\n, \t, \", 反斜杠...
**************************************
第三章: Perl scripts
1: 找到 perl interpreter 的位置:(也就是程序开头 shbang line 后面要写的内容: #! /usr/bin/perl )
which perl
(or : find / -name '*perl' -print;
2:
相关阅读 更多 +