use strict; use warnings; my @ids = (123, 456, 789); my @names = qw(Smith Doe Allen); foreach my $i (0 .. $#ids) { print "$ids[$i] $names[$i]\n"; }