If I want to count from zero in steps I have used.
print $_,'' for map{$_*5} 0 .. 5 0 5 10 15 20 25
You could also do
foreach ( ('a'..'z')[map{$_*5}0..5] ) { print $_,''; } a f k p u z
or for an array
@array = (0..50) foreach ( @array[map{$_*5} 0..@array/5] ) { print $_,''; } 0 5 10 15 20 25 30 35 40 45 50
Or for a hash
@hash{'a'..'z'} = (1..26); foreach ( (keys %hash)[map{$_*5}0 .. (scalar keys %hash)/5] ) { print "hash{$_} = $hash{$_}\n"; } hash{a} = 1 hash{f} = 6 hash{k} = 11 hash{p} = 16 hash{u} = 21 hash{z} = 26
Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.
In reply to Re: foreach .. stepping?
by BrowserUk
in thread foreach .. stepping?
by meetn2veg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |