http://www.perlmonks.org?node_id=1053930


in reply to Order of execution of functions in list

Operand evaluation order isn't defined for all operators[1], but it is for this one.

Quote perlop,

In list context, [,] is just the list argument separator, and inserts both its arguments into the list. These arguments are also evaluated from left to right.

That's perfectly fine.


  1. For example, Perl doesn't define the order in which f, g and h will be called by f() + g() + h().

Replies are listed 'Best First'.
Re^2: Order of execution of functions in list
by LanX (Saint) on Sep 13, 2013 at 14:17 UTC
    So in function calls it's not a list argument separator ?

    function($i++,++$i) ???

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      So in function calls it's not a list argument separator ?

      Sure it is.

      function($i++,++$i) ???

      $i++ is going to be evaluated before ++$i.

Re^2: Order of execution of functions in list
by vsespb (Chaplain) on Sep 13, 2013 at 13:26 UTC
    Ok, thanks! That was exactly what I looked for!