Re: Deleting a line that contains certain text

2003-09-08 Thread Scott R. Godin
David Wall wrote: > > > --On Saturday, September 06, 2003 7:45 PM -0400 perlwannabe > <[EMAIL PROTECTED]> wrote: > >> OK, I have a new problem. I need to delete an entire line that contains >> certain text. I have done an extensive search and had no luck finding an >> adequate answer. Yes, I

Re: Deleting a line that contains certain text

2003-09-07 Thread John W. Krahn
"R. Joseph Newton" wrote: > > "John W. Krahn" wrote: > > > > rename $file, "$file.bak" or die "Cannot move $file to $file.bak: $!"; > > I would say that this is the wrong place for the rename. Computers do crash. > If a crash occurs while this program is in progress, then he is left with a > re

Re: Deleting a line that contains certain text

2003-09-07 Thread R. Joseph Newton
"John W. Krahn" wrote: > > Also, I would like to run this from within a script instead of from the > > command line. > > > > BTW...using PERL 5.8.0 on Windows2000 Pro > > Here is one way to do it: > > use warnings; > use strict; > > my $file = shift or die "usage: $0 filename\n"; > > rename $file,

Re: Deleting a line that contains certain text

2003-09-06 Thread John W. Krahn
Perlwannabe wrote: > > OK, I have a new problem. I need to delete an entire line that contains > certain text. I have done an extensive search and had no luck finding an > adequate answer. Yes, I also saw the FAQ that just refers me to > Tie::file. The most promising solution was: > > perl -n

Re: Deleting a line that contains certain text

2003-09-06 Thread David Wall
--On Saturday, September 06, 2003 7:45 PM -0400 perlwannabe <[EMAIL PROTECTED]> wrote: OK, I have a new problem. I need to delete an entire line that contains certain text. I have done an extensive search and had no luck finding an adequate answer. Yes, I also saw the FAQ that just refers me