develooper Front page | perl.perl5.porters | Postings from May 2012

Re: Bug? (was Re: proposal: functional C<if>...)

Thread Previous | Thread Next
From:
David Nicol
Date:
May 7, 2012 22:20
Subject:
Re: Bug? (was Re: proposal: functional C<if>...)
Message ID:
CAFwScO9GQHrE9w1g68xTuuq19CK=8Lb=D1fYWp0hwVm3j31QRg@mail.gmail.com
> Linda W wrote:
>
>> Why should this yield an error:
>>
>>   @_ ?      #if (@_) {
>>     ($M, $tM)=(shift, 100*$H+$M)
>>     : #}else{
>>     ($H, $M) = (int $H/100,  $tM % 60);
>>   #}
>>
>
how about: because if it didn't yield an error, when @_ is non-empty
($M,$tM) would get assigned to twice, which is surely not what the coder
wants.


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