http://www.perlmonks.org?node_id=887940

sufi has asked for the wisdom of the Perl Monks concerning the following question:

Greetings everyone I have data in a text file in which each line of the file has spaces among words, I want to replace all of these spaces with Commas and then write this new content to another text file with each line on new line of 2nd text file. I want to know: 1. Open file 2. Read it in array for accessing each line individually 3. Replace spaces with commas in each line 4. Write these new comma separated lines to new text file My data format: 0 boomerang 7 1 2005-12-15 19:31:50 0 shop 7 1 2005-12-15 19:31:50 0 bibtex 8 1 2005-12-13 08:42:37