my %hash; open FH, "<", "/path/to/file" or die "Can't open file: $!"; while() { chomp; if($_ =~ m/^([^:]+): (.*)$/) { $hash{$1} = $2; } } close FH;