in reply to printing arrays

TIMTOWTDI: Limits the output to the shortest sequence but comes at the cost of an implicite extra-array...

use strict; use warnings; my @ID = qw(123 456 789 666); my @name = qw(Smith Doe Allen); my $line = join(' ', map { $ID[$_], $name[$_] } 0..($#ID < $#name ? $#ID : $#name) ); print "($line)\n"; #output: (123 Smith 456 Doe 789 Allen)