in reply to map a hash with a default value or exclude

If you can live with a map-less solution, this excludes keys without values:
use warnings; use strict; use Data::Dumper; $Data::Dumper::Sortkeys = 1; my %info; while (<DATA>) { chomp; my ($k, $v) = split /=/; $info{$k} = $v if length $v; } print Dumper(\%info); __DATA__ a=5 b=6 c= d=7
prints:
$VAR1 = { 'a' => '5', 'b' => '6', 'd' => '7'
This keeps the key, with a default value:
while (<DATA>) { chomp; my ($k, $v) = split /=/; $info{$k} = (length $v) ? $v : 666; }