in reply to Elegantly Selecting Every 3rd Element in an Array.
my $count = 0; my @every_3rd = grep { ( ++$count % 3 == 0 ) } @array;
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Elegantly Selecting Every 3rd Element in an Array.
by runrig (Abbot) on Sep 29, 2001 at 02:12 UTC | |
by jerrygarciuh (Curate) on Sep 29, 2001 at 02:37 UTC | |
by gbarr (Monk) on Sep 29, 2001 at 03:03 UTC | |
by runrig (Abbot) on Sep 29, 2001 at 03:15 UTC | |
by tye (Sage) on Sep 29, 2001 at 03:26 UTC |