if you talking about operators precedence, so we can calculate that expression by the next way:
$x + ++$x + $x++:
first:
++$x - ok, at now here returns 6.
second:
$x++ - ok, at now here return 6, but $x will right now is 7 so we must get 21, if anywhere we get $x object as is, -but it isn't so.
we can get 19, if we get values, not objects - i've mean 7+6+6
we will get
5(value of copy of the object before any object changes)+7(at this position is value of original object $x)+6(at this position copy of $x after we make ++$x) == 18 - by logic which I describe.

Let's make first other operation - $x++ not ++$x - we get 5 here anyway.
then we make ++$x ($x == 6 ) - ok - we get 7 here. 7+5==12.
for getting at now 18 as a result we must take $x==6 - look's like it is absolutely wrong.

so..
by operators precedence from perlop(at perldoc) we can say that we calculate it from left to right.
why in position of $x - we get value of copy $x not for the moment of calculation, but for the moment of expression calculation begin.

In reply to Re^2: question 1st - undefined behaviour (perlop) by rumos2
in thread question 1st - undefined behaviour by rumos2

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.