in reply to breaking a text file into a data structure -- best way?
One of the many answers to #1 would be to:
read a line - store it
read the next line - compare it, if it matches your ----- or ****, then save the first line as your key.
Read the two lines.
If either of them are your ----- or ****, then save the previous one as the next key, and the ones before it as the previous hash's values.
Another possible solution:
Start by reading the whole file into an array, one line per entry. Find the ----- lines, and split at one position before it, and use that section to create your hash.
It might not be the best way, but its the first couple that come to mind.