http://qs321.pair.com?node_id=968936


in reply to foreach only for a section of a list

One possibility is to only iterate over the elements of the array you need, using a slice:
use strict; my @somewords = ("a", "b", "c"); foreach my $core (@somewords[0..$#somewords-1]) { print "${core};\n"; }