my (@firms); while (defined( my $line = ) ){ chomp $line; my (%hash); my ($type, $location1, $location2, $label) = split ',', $line, 12; $hash{type} = $type; $hash{label} = $label; push @firms, \%hash; }