Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-07 Thread David Mertens
On Thu, Jul 6, 2017 at 11:05 PM, wrote: > Perl is highly unusual in that the operator, not the operand, dictates the >> context. >> > > Good point - and one that I hadn't got around to noticing. > > Therefore, the '!' operator has to be set up to either: > a) operate always in numeric context; >

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-07 Thread Илья Рассадин
Hi! You don't need logical string negotiation and logical number negotiation. You just need logical negotioation. Using `!` operator to convert non-empty string to empty string is wrong, so as using `!` operator to convert not zero number to zero. `!` operator is for logical operations only