1.

Among the Terms and Lists (operators), which one has the highest precedence in Perl?

Answer»

In Perl, both Terms and lists have the highest precedence. Terms INCLUDE expressions in parenthesis, variables, etc. List OPERATORS ALSO render the same level of precedence as that of terms. Both these operators have strong left word precedence. 

The ENTIRE list of operator precedence in Perl looks like: 

->
left
++ --
nonassoc
**
right
! ~ \ and unary + and -
right
=~ !~
left
* / % x
left
+ - .
left
<< >>
left
< > <= >= lt gt le ge
nonassoc
== != <=> eq ne cmp
nonassoc
&
left
| ^
left
&&
left
||
left
..
nonassoc
?:
right
= += -= *= etc.
right
, =>
left
not
right
and
left
or xor
left


Discussion

No Comment Found