Operator Precedence in Perl

What is Operator Precedence in Perl?

Explanation

The following table displays the Operator Precedence in Perl.
Associativity Operators
left Terms and list operators (leftward)
left ->
nonassoc ++ --
right **
right ! ~ n + - (unary)
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. (assignment operators)
left , =>
nonassoc List operators (rightward)
right not
left and
left or xor

Ask Questions

Ask Question