in reply to Traversing succeding sets of an array

Yet another way, that works for exactly 2 elements.
my @foo = qw (one two three four five six seven eight nine ten); while ($c <$#foo){ ($s,$a)= @foo[$c++ .. ++$c+1]; print "$s $a\n"; }