- 论坛徽章:
- 145
|
回复 1# better0332
'for' is not operators and no precedence issue with common sign
$ perldoc perlop
...
Perl operators have the following associativity and precedence, listed
from highest precedence to lowest. Operators borrowed from C keep the
same precedence relationship with each other, even where C's precedence
is slightly screwy. (This makes learning Perl easier for C folks.)
With very few exceptions, these all operate on scalar values only, not
array values.
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
|
|