One method is to read, substitute then overwrite.
Code:
open (RFILE, "<path to your file") or &error("Unable to read your file");
if ($flock eq "y") {
flock RFILE, 2;
}
@file=<RFILE>;
close (RFILE);
foreach $line (@file) {
if ($line=~ s/your existing phrase here/your new phrase here/g) {
}
}
open (WFILE, ">path to your file") or &error("Unable to write your file");
if ($flock eq "y") {
flock WFILE, 2;
}
print WFILE @file;
close (WFILE);
[This message has been edited by Dave (edited July 16, 1999).]