in reply to sed isn't working within a perl script
:D Calling sed from perl is like driving a bicycle inside a car -- just drive the car
The perl oneliner equivalent (as s2p helps me understand it)
perl -i -l -p -e ' s /(.*)/Number => ${1}/s; ' test.txt
But you still don't want to use system to run that oneliner
instead use
use File::Slurp qw/ edit_file /; edit_file { s /(.*)/Number => ${1}/s; } 'test.txt';
or some such
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sed isn't working within a perl script
by Anonymous Monk on Oct 19, 2012 at 09:42 UTC | |
|
Re^2: sed isn't working within a perl script
by nvivek (Vicar) on Oct 19, 2012 at 10:37 UTC | |
by Anonymous Monk on Oct 19, 2012 at 11:48 UTC |