develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119873] Bleadperl v5.19.3-583-g80d2c56 breaks WSNYDER/IPC-Locker-1.492.tar.gz

Thread Previous
From:
Steve Hay
Date:
September 18, 2013 14:06
Subject:
Re: [perl #119873] Bleadperl v5.19.3-583-g80d2c56 breaks WSNYDER/IPC-Locker-1.492.tar.gz
Message ID:
CADED=K74ZGtLHZ33a69J3y6o471T4n=FLjCO=ASYmYQ4+38-hQ@mail.gmail.com
On 18 September 2013 13:38, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> wrote:
> Steve Hay <steve.m.hay@googlemail.com> writes:
>
>> On 18 September 2013 10:54, Andreas Koenig
>> <andreas.koenig.7os6VVqR@franz.ak.mind.de> wrote:
>>> Steve Hay <Steve.Hay@verosoftware.com> writes:
>>>
>>>> I'm confused by this report (and the three cpantesters reports listed
>>>> above) because the offending commit (80d2c56d79) only changes anything
>>>> when running on MSWin32, but all these reports are from linux.
>>>
>>> Precendence of the ternary:
>>>
>>> % perl -MO=Deparse,-p
>>> $^O eq 'MSWin32' &&$! == ($] < 5.019004) ? 10022 : Errno::EINVAL
>>> ^D
>>> ((($^O eq 'MSWin32') && ($! == ($] < 5.019004))) ? '???' : '???');
>>> - syntax OK
>>>
>>
>> Gah!
>>
>> Thanks for pointing that out. Now fixed in commit a576a29029.
>
> If the intention is to compare $! to a different value depending on the
> condition $] < 5.019004, it's still wrong, due to the low precedence of
> the ternary operator:
>
>     $ perl -MO=Deparse,-p
>     ($! == ($] < 5.019004) ? 10022 : Errno::EINVAL)
>     ^D
>     (($! == ($] < 5.019004)) ? '???' : '???');
>     - syntax OK
>
> You need this:
>
>     $ perl -MO=Deparse,-p
>     ($! == ($] < 5.01904 ? 10022 : Errno::EINVAL))
>     ^D
>     ($! == (($] < 5.01904) ? 10022 : 'Errno::EINVAL'));
>     - syntax OK
>
> Add the extra parentheses around the condition if you wish to be
> explicit.
>

Thank you for picking up on this. I'm rather embarrassed that I wasn't
paying sufficient attention myself.

Now really fixed in commit 7a4148d0eb.

Thread Previous


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