in reply to Reading configuration file with only v5.8
Um ... I'll bite. Why can't you install anything from CPAN?
while (<FILE>) { chomp; s/^\s+//; s/#.*//; s/\s+$//; next unless length; if (/^(.*?\S)\s*=\s*(.*)$/) { push @{$CONFIG{$key}}, $val; } }
The only thing that makes sense to me is storing an array reference in the hash if you're going to do it by hand. I took the liberty of making a few minor changes.
|
|---|