in reply to Re^4: ternary conditional help
in thread ternary conditional help

This is because the entire expression is evaluated before being passed as arguments to print

No, the arguments are placed on the stack as they are evaluated.

  1. $a = 2 is evaluated and the result ($a) is placed on the stack.
  2. ' ' is evaluated and the result is placed on the stack.
  3. $a = 3 is evaluated and the result ($a) is placed on the stack.
  4. "\n" is evaluated and the result is placed on the stack.
  5. print is evaluated.

@_ isn't even constructed here since print is an operator, not a sub.

The reason you get the observed behaviour is that $a itself (not a copy of it) is placed on the stack.