How can we tell what the desired output is? You don't tell us or show us and you haven't bothered to format your node so we probably couldn't tell what the output should look like even if you did show us.
Until you sort your node out somewhat, the best we can do is offer some general advice unless someone recognises the source of the code and understands the context in which it is intended to be used. You don't seem to wish to disclose the source and can't be bothered to tell us how or why the code is used so what do you expect?
Perl reduces RSI - it saves typing
|