use List::MoreUtils qw( zip ); sub test { my @name = qw( Joe mary ann pete amy jerry ); my @email = qw( joe@test.com mary@test.com ann@nowhere.com pete@here.com amy@ok.com jerry@b.com ); return zip @name, @email; }