in reply to Re^8: Operator overloading with returning lists?
in thread Operator overloading with returning lists?

I still have no clue what you mean by "precedence is stronger than scalar_of_array". Could you explain what you mean instead of just giving examples? The result of your example is quite obvious to me; it doesn't contain a single surprise. But it doesn't explain to me what an earth "precedence is stronger than scalar_of_array" is. To me, it sounds as logical as "wednesday is bluer than noise".
  • Comment on Re^9: Operator overloading with returning lists?

Replies are listed 'Best First'.
Re^10: Operator overloading with returning lists?
by LanX (Saint) on Dec 01, 2008 at 16:43 UTC
    That the code in the parens have precedence in evaluation before a scalar-like function is applied on a returned list.

    Cheers Rolf

      Well, yes, but that's because what's inside the parens is an operand of an operator whose result is an argument to the function. It's not any different from:
      some_sub(EXPR1 + EXPR2)
      EXPR1 is evaluated before some_sub is called. And since perl5 doesn't have lazy evaluation, and unlike to get it any time soon, it's going to stay like this for a while.

      But that has little to do with precedence (or at least not with the precedence people talk about when talking about operator precedence); the only 'rule' that's in effect is that arguments (and parameters) are evaluated before the operators/subs themselves.