in reply to Re: split line and populate hash shortcut ?
in thread split line and populate hash shortcut ?

Or
m[^([^#][^=]+)=([^#\n]*)] and $config{ $1 } = $2 while <DATA>;
To allow end of line comments and remove newlines from the "value" part. Removing trailing spaces is left as an exercise to the reader :-)