Re: Perl script to search and replace a string in a file

2006-06-02 Thread Luke Bakken
>> > perl -pi -e 's/original text/new text/g' * >> >> Error: Can't do inplace edit without backup. > > You need either perl -pi.bak -e ... or an OS upgrade. Windows, > unfortunately, can't manage this. This isn't a Windows problem, this is a Perl on Windows problem that is solely in the Perl i

Re: Perl script to search and replace a string in a file

2006-06-02 Thread Michael Goldshteyn
"Paul Johnson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, Jun 01, 2006 at 08:11:49AM -0500, Michael Goldshteyn wrote: > >> "Ricky Zhou" <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >> > perl -pi -e 's/original text/new text/g' * >> >> Error: Can't do i

Re: Perl script to search and replace a string in a file

2006-06-01 Thread Paul Johnson
On Thu, Jun 01, 2006 at 08:11:49AM -0500, Michael Goldshteyn wrote: > "Ricky Zhou" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > perl -pi -e 's/original text/new text/g' * > > Error: Can't do inplace edit without backup. You need either perl -pi.bak -e ... or an OS upgrad

Re: Perl script to search and replace a string in a file

2006-06-01 Thread Michael Goldshteyn
"Ricky Zhou" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > perl -pi -e 's/original text/new text/g' * Error: Can't do inplace edit without backup. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl script to search and replace a string in a file

2006-05-31 Thread Ricky Zhou
On 5/31/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote: I have the following script that takes in an input file, output file and replaces the string in the input file with some other string and writes out the output file. I want to change the script to traverse through a directory of files ie instea

RE: Perl script to search and replace a string in a file

2006-05-31 Thread Timothy Johnson
Check out the File::Find module. It should come standard with your distribution. -Original Message- From: Nishi Bhonsle [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 31, 2006 2:39 PM To: beginners@perl.org Subject: Perl script to search and replace a string in a file Hi: I have the

Perl script to search and replace a string in a file

2006-05-31 Thread Nishi Bhonsle
Hi: I have the following script that takes in an input file, output file and replaces the string in the input file with some other string and writes out the output file. I want to change the script to traverse through a directory of files ie instead of prompting for input and output files, the sc