my @array = qw( wilma fred barney betty ); for my $i (0 .. $#array) { printf( "We have %s, while %s is next.", $array[$i], $array[$i + 1] ); }