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

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

Thread Previous | Thread Next
From:
Tomasz Konojacki
Date:
June 25, 2018 23:54
Subject:
Re: [perl #133301] Evalulation order during concat changed
Message ID:
20180626015425.ED96.5C4F47F8@xenu.pl
On Mon, 25 Jun 2018 04:46:07 -0700
" \(via RT\)" <perlbug-followup@perl.org> 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 poc.pl; perl poc.pl; perl2 poc.pl
> $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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About