Re: Modifing Text Files

2007-10-29 Thread Chas. Owens
On 10/28/07, Telemachus Odysseos <[EMAIL PROTECTED]> wrote: > On 10/25/07, Chas. Owens <[EMAIL PROTECTED]> wrote: > > From the sound of it what you want is in-place-editing: > > > > #!/usr/bin/perl -i > > > > use strict; > > use warnings; > > > > while (<>) { > > s/this/that/ > > } > > > > The

Re: Modifing Text Files

2007-10-28 Thread Telemachus Odysseos
On 10/25/07, Chas. Owens <[EMAIL PROTECTED]> wrote: > > From the sound of it what you want is in-place-editing: > > #!/usr/bin/perl -i > > use strict; > use warnings; > > while (<>) { > s/this/that/ > } > > The code above will read in any number of files modifying "this" to > "that" in each on

Re: Modifing Text Files

2007-10-27 Thread John W . Krahn
On Thursday 25 October 2007 09:30, Joseph L. Casale wrote: > I need to make some edits on small (~30 lines) text files. From > reading perldoc and recent posts, am I correct in understanding that > the proper way is to read the file in through one handle and write it > out through another? If that

Re: Modifing Text Files

2007-10-25 Thread Chas. Owens
On 10/25/07, Joseph L. Casale <[EMAIL PROTECTED]> wrote: > I need to make some edits on small (~30 lines) text files. From reading > perldoc and > recent posts, am I correct in understanding that the proper way is to read > the file in > through one handle and write it out through another? If tha