in reply to foreach .. stepping?
which prints:sub step { my $step = shift; return grep {($_ - $_[0]) % $step == 0} @_ } foreach (step 5, 2 .. 100) { print "$_ " }
2 7 12 17 22 27 32 37 42 47 52 57 62 67 72 77 82 87 92 97
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: foreach .. stepping?n
by mce (Curate) on Nov 20, 2002 at 13:39 UTC |