Hello,
I wasn't able to understand what you're trying to do
exactly from your description, but I did look at your
code, and I'm puzzled by it. A few oddities:
- Where do you assign into @field?
- Why do you use the for syntax in $newline{$_} = 1 for qw(MSH);?
- Your program flow might be overly complex -- I have
a pretty strong intuition that, if I understood
what you're trying to do, that it would be a much
simpler block of code.
So, if you can elaborate exactly what you're trying to do,
I'm sure we'll be able to help you.