while () { if (/^\s*#/) { # ignore comment line } elsif (/^\s*$/) { # ignore blank line } elsif (/(\w+)\s*=\s*[<]{2}(\w+)/) { # heredoc (my $name, local $/) = ($1, "\n$2"); # ++ysth $config{$name} = ; chomp $config{$name}; # as etcshadow points out. } elsif (/(\w+)\s*=\s*(.*?)\s*$/) { # regular pair $config{$1}=$2; } else { warn "Ptooey: Could not parse config line: $_\n"; } }