my @list1; for (LIST) { push @list1, B; } my @list2; for (@list1) { push @list2, A; } my @array = @list2;