while () { my @line = split; my %hash; @hash{+KEYS} = @line; push @array, {%hash}; }