in reply to Re: Better Way of Manipulating Array Elements
in thread Better Way of Manipulating Array Elements
Since it appears to be a complete program, the following would do:
perl -pe'chomp; s/(d)/new($1)/; s/^/,/ if $.-1'
I first considered the following, but it leaves a trailing comma and no LF at file's end:
perl -pl54e's/(d)/new($1)/'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Better Way of Manipulating Array Elements
by morgon (Priest) on May 20, 2009 at 00:02 UTC | |
by ikegami (Patriarch) on May 20, 2009 at 00:05 UTC | |
by morgon (Priest) on May 20, 2009 at 00:19 UTC |