Perl Monk, Perl Meditation | |
PerlMonks |
Re: Re: Re: Re: Elegantly Selecting Every 3rd Element in an Array.by gbarr (Monk) |
on Sep 29, 2001 at 03:03 UTC ( [id://115536]=note: print w/replies, xml ) | Need Help?? |
It prints nothing because you have a precedence problem
not ($_+1) % 3 Will always evaluate to false as it is the same as (not ($_+1)) % 3 Adding some parens in the right places not (($_+1) % 3) Should give the correct result
In Section
Seekers of Perl Wisdom
|
|