in reply to Re: Re: Re: Re: Re: Elegantly Selecting Every 3rd Element in an Array.
in thread Elegantly Selecting Every 3rd Element in an Array.
It is the old "if it looks like a function call" rule. Most commonly noted for: print ($this),$that getting parsed as print($this), $that but it also applies to other things, including the not "function". Update, the application of this particular rule to not appears to have been introduced in Perl 5.6.0, so it might even be a bug.
BTW, the proof that this is the problem is that adding a unary "plus": not +($_+1) % 3 fixes it.
- tye (but my friends call me "Tye")
|
|---|