in reply to Need Help Mapping Arrays

I would use an array of hashrefs, because you know you’re going to have a certain number of rows whether those rows are empty or filled.

Another trick is to capture the column-headings as you encounter them.   A hash is very handy for this.   If you simply do $$keys_encountered{$heading} = 1; along the way, you can use sort keys(%$keys_encountered) to read all of the column headings you actually encountered, in alphabetic order.   (In this case, the value of the hash entry is unimportant; you care about the presence of the key.)