- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2015-01-14 15:41 编辑
回复 1# jiangphoenix
$ perldoc perlop
NAME
perlop - Perl operators and precedence
DESCRIPTION
Operator Precedence and Associativity
Operator precedence and associativity work in Perl more or less like they
do in mathematics.
Operator precedence means some operators are evaluated before others. For
example, in "2 + 4 * 5", the multiplication has higher precedence so "4 *
5" is evaluated first yielding "2 + 20 == 22" and not "6 * 5 == 30".
...
left terms and list operators (leftward)
left ->
nonassoc ++ --
right **
right ! ~ \ and unary + and -
left =~ !~
left * / % x
left + - .
left << >>
nonassoc named unary operators
nonassoc < > <= >= lt gt le ge
nonassoc == != <=> eq ne cmp ~~
left &
left | ^
left &&
left || //
nonassoc .. ...
right ?:
right = += -= *= etc.
left , =>
nonassoc list operators (rightward)
right not
left and
left or xor
...
|
|