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

That the code in the parens have precedence in evaluation before a scalar-like function is applied on a returned list.

Cheers Rolf

  • Comment on Re^10: Operator overloading with returning lists?

Replies are listed 'Best First'.
Re^11: Operator overloading with returning lists?
by JavaFan (Canon) on Dec 01, 2008 at 16:53 UTC
    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.