use Data::Dumper; my %h; open FH, "test"; while () { chomp; next if /^\s*$/; split /=/; push @{$h{$_[0]}}, $_[1]; } close FH; print Dumper \%h;