# instead of this my $c = 0; my @columns = split(/\t/,$_); push @a, { map { $header[$c++] => $_ } @columns }; # do this my %row; @row{@header} = split(/\t/,$_); push @a, \%row;