in reply to Re: foreach loops
in thread foreach loops
use strict; use warnings; my @names = qw{rita sue bob daisy}; $, = q{ }; $\ = qq{\n}; foreach (0 .. $#names) { print $_ == $#names ? $names[$_] : @names[$_, $_ + 1]; }
Cheers,
JohnGG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: foreach loops
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 |