in reply to Deleting on Text File
open (FILE, "sample.txt") || die "cannot open sample.txt"; while (<FILE>) { s/<\?--1-Stock3of1-->//; s/<b>This is option Stock 3 of 1<\/b>//; s/<\/\?--1-Stock3of1-->//; push (@words, $_); } close (FILE) || die "cannot close sample.txt"; open (FILE, ">sample.txt") || die "cannot open sample.txt"; foreach (@words) { print FILE; } close (FILE) || die "cannot close sample.txt";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Deleting on Text File
by Chady (Priest) on Oct 23, 2002 at 10:18 UTC |