in reply to foreach loops
Output:use strict; my @names = ('rita', 'sue','bob', 'daisy'); $, = ' '; $\ = "\n"; foreach (0 .. $#names) { print @names[$_, $_+1]; }
rita sue sue bob bob daisy daisy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: foreach loops
by johngg (Canon) on Oct 07, 2006 at 23:25 UTC | |
by richill (Monk) on Oct 08, 2006 at 07:57 UTC | |
by lyklev (Pilgrim) on Oct 08, 2006 at 12:28 UTC | |
by shmem (Chancellor) on Oct 08, 2006 at 12:42 UTC |