#!/usr/bin/perl use strict; use warnings; use 5.14.0; my @a1 = qw (a b d e f g); my @a2 = qw (1 2 3 4 5 6 7); my $i = 0; my $count = $#a1 > $#a2 ? $#a1 : $#a2; for (0 .. $count) { no warnings 'uninitialized'; say "$_: $a1[$_] - $a2[$_]"; }