BY DEFINING WHAT EXACTLY DOESN'T WORK SO THAT WE CAN DIAGNOSE THE PROBLEM
Do any of these situations ever apply to you?
You: Mr mechanic, my car doesn't work/
Mechanic: Sounds like a fuel injection problem, here let me replace.......
You: Doctor, I don't feel good
Doc: Sounds like you have a liver infection. Take two of these and call me in the morning
You: Hello, Microsoft tech support? Yeah my computer doesn't work
Microsoft: Reboot
(ok maybe that one's possible)
The point is, you can't say "Hey programmers my script doesn't work" and expect us to say "oh well, that obviously [some problem]" without us having any details about what exactly the problem is.
Now, try again. This time with DETAILS describing what the problem is, what your results are, what your expected results were etc etc etc.
The more details we have, the more we can help you.
The tiny code snippet you posted looks fine, which is WHY I asked you to DEFINE what exactly wasn't working.
My guess is that they're splitting and printing, but not in the right order. If that is correct, post a sample of the input text, and what is being output too. Actually, post that info anyway.
--mark