while (my $line = ) { my @line = split /\t/, $line; my %hash = ( key0 => $line[0], key1 => $line[1], key2 => $line[2], key3 => $line[3], key4 => $line[4], ); print "Key 3 is $hash{key3}\n"; push @lines_of_file, \%hash; } #### while (my $line = ) { my %hash; @hash{qw(key0 key1 key2 key3 key4)} = split /\t/, $line; print "Key 3 is $hash{key3}\n"; push @lines_of_file, \%hash; }