in reply to Modifying text file
use warnings; use strict; while (<DATA>) { s/(\w+)/$1,/g; print; } __DATA__ This is a word. Here is another sentence.
Prints:
This, is, a, word,. Here, is, another, sentence,.
See also perlintro
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Modifying text file
by torres09 (Acolyte) on Jun 05, 2013 at 12:57 UTC | |
by toolic (Bishop) on Jun 05, 2013 at 12:59 UTC | |
by torres09 (Acolyte) on Jun 05, 2013 at 13:04 UTC | |
by 2teez (Vicar) on Jun 05, 2013 at 13:19 UTC | |
by hdb (Monsignor) on Jun 05, 2013 at 13:33 UTC | |
by torres09 (Acolyte) on Jun 06, 2013 at 09:42 UTC | |
by Anonymous Monk on Jun 06, 2013 at 10:05 UTC | |
|
Re^2: Modifying text file
by torres09 (Acolyte) on Jun 06, 2013 at 09:56 UTC | |
by Anonymous Monk on Jun 06, 2013 at 10:00 UTC | |
by Anonymous Monk on Jun 06, 2013 at 10:04 UTC |