Such strange behavior of "~" operator (implicit signed integer context) seems to be also in slices and array indexes: $ perl -le '@arr=1..5; print @arr[~1], $arr[~1]' 44 Kind regards, Sergey Zhmylove. 31.08.2016 3:58, Father Chrysostomos wrote: > Matt S Trout wrote: >> THis seems inconsistent at best, but I wasn't sure exactly what to >> report. > It is inconsistent. I think it is a bug. But deciding how it should > behave is the hard part. Can we change it without breaking peo- > ple's code? > > I suppose the way to change it without breaking people's code is to > make foreach match the dotty behaviour.Thread Previous | Thread Next