develooper Front page | perl.perl5.porters | Postings from June 2018

Re: [perl #133301] Evalulation order during concat changed

Thread Previous | Thread Next
Tomasz Konojacki
June 25, 2018 23:54
Re: [perl #133301] Evalulation order during concat changed
Message ID:
On Mon, 25 Jun 2018 04:46:07 -0700
" \(via RT\)" <> wrote:

> I presume this is down to the new multiconcat op, but the following
> line has changed behaviour and I couldn't see any mention of it in
> the docs.
> cat; perl; perl2
> $n=1;print$^V.' '.$n.' '.--$n."\n";
> v5.26.1 1 0
> v5.28.0 0 0

I'm not 100% sure if it's relevant, but perlop says:

Note that just as in C, Perl doesn't define when the variable is incremented or decremented. You just know it will be done sometime before or after the value is returned. This also means that modifying a variable twice in the same statement will lead to undefined behavior. 

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About