|Think about Loose Coupling|
Parsing a Tagged File Formatby arunhorne (Pilgrim)
|on Apr 30, 2003 at 10:28 UTC||Need Help??|
arunhorne has asked for the
wisdom of the Perl Monks concerning the following question:
I have a text file in the format below:
Basically it is a tagged file and I need to load it into a hash. As you can see it has potentially has more than one line per tag. I want to create a hash that maps each tag (tags are unique) to an array of the lines associated with that tag, i.e.
Tag names are always two letter but may be arbitrary and therefore cannot be hardcoded, however, the file is always terminated by a tag named ER.
Can anyone provide me with the code to translate this text into a hash to my requirements, I just can't seem to handle the multiline case.
Thanks in advance____________