in reply to Re^2: To return and/or not?
in thread To return and/or not?

So basically the operators...

Yeah, perldoc perlop indeed says that not/and/or/xor have the lowest precedence

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

Seems a strange decision.

How many other programming languages do you know? That have the keywords not/and/or/xor as operators?

Replies are listed 'Best First'.
Re^4: To return and/or not?
by Anonymous Monk on Oct 08, 2011 at 10:37 UTC

    What other programming languages?

    OK, I think I get it - its not that return is strange, its that not, and, or , xor are lower precedence than everything else (eg other operators, statements like return, and functions like open). I expected return to be even lower precedence.

      What other programming languages?

      That is what I asked you :) What previous programming experience do you have that makes perls precedence order seem strange