BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

Update: Damn it! Never mind; the penny dropped. It's the same order of evaluation thing there's been a couple of recent threads about: $d[ $pB-1 ] = $d[ $pB++ ]

There's no guarantee that $pB-1 will be evaluated before $pB++; even though the post increment guarantees that the preincrement value will be used for the second subscript.


Why is this:

my $pB; for( $pB = $topB+1; $pB < $topC && $d[ $pB ] < $temp; $d[ $pB-1 ] = $d +[ $pB++ ] ) { };

Not equivalent to this?

my $pB; for( $pB = $topB+1; $pB < $topC && $d[ $pB ] < $temp; $d[ $pB-1 ] = $d +[ $pB ], $pB++ ) { };

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked