use strict; use warnings; my @a=(1,2,3); my @b=(2,4,6,7); foreach $a[1] (@b) { print $a[1] }