or download this
chop (%key_hash = map { split /\s*[|]\s*/,$_,2 } grep (!/^$/,<KEY_FH>)
+);
^ ^ ^ ^ ^ ^ ^ ^
...
| | + - Vertical bar as only member in
+character set
| + - Zero or more whitespaces
+ - Should be 'chomp' to remove the trailing newlines