I have tried the split and join functions but stuck with unexpected results. Any help appreciated. I pass multiple values at command line like perl test.pl -type java,xml . This works good for me but i am not sure how to print it in the required format.
Your solution works good for me. I would request you if the output can be "\.java \.xml". I want " " to be included in the output and not just \.java \.xml
Honestly, that question goes beyond "I need help with a problem" and enters the "I don't want to think for myself" realm. Experiment! Try things! That's the best way to learn.