while () { my %hash; # make a new hash and assign values # keys are DATA .. COMMENTS, and values come from # the split. @hash{qw/DATE TITLE URL COMMENTS/} = split /\|/; push @all_array, \%hash; } close(FILE); #### @cols = qw/DATE TITLE URL COMMENTS/; @all_array = map{ my %h; @h{@cols} = split /\|/; \%h};