in reply to making a text file to an hash array

The main problem here seems to be the irregularity of empty hash values (i.e. d and e in your example).

One possibility would be to split on white space, then manually loop through the array - if the array element starts with a letter, it is the hash key, and if the following array element starts with a digit, that is the value; otherwise the value would be [].

-- 
Ronald Fischer <ynnor@mm.st>