my @fields = qw/id projname status submitdt assign_dt total complete_dt person dept closed_dt/; # Create my array of hashes. foreach (@Data) { my %hash; @hash{@fields} = split /\|/, $_; $_ = \%hash; }