use strict; my @array; while () { chomp; s,",,g; push @array , [ split/[:,]\s?/]; } __DATA__ COLUMN_A: "Y","N" COLUMN_B: COLUMN_C: "something", "something else", "and more"