0: #>To get every nth element out of a list, use grep (one of the most under-appreciated built-ins?).</p>
1:
2: (For every fourth element in @List)
3: grep {not ++$i % 4} @List;
4:
5:
6: #(To skip every fifth element)
7: grep {++$i % 5} (1..50)</code>
8:
9: #Simple, but it makes a cool one-liner if you need it... In reply to Get every nth element by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |