R
Ron M.
I do a lot of web page maintenance, which includes frequently updating
some old sites with large numbers of static, text-based pages in a
UNIX or AIX environment. I use several Perl "tools" in my work,
although I'm not a Perl programmer.
Task: use the following Perl code to replace all occurrences of the
string, "this is the old string" with "this is the new string" and
create backup files with the ".back" suffix. Do this with all files
whose filename contains the string, ".html."
perl -pi.back -e 's/this is the old string/this is the new string/g'
*.html*
Problem: if, in the actual file, the string, "this is the old string"
is broken over two lines, the Perl code won't work! It has to be all
on the same line, or the text won't be replaced, and I have to go back
through each file one at a time and manually replace it in vi, which
is kinda self-defeating.
If it's possible, can somebody please change this Perl string so it
will catch those broken strings?
(please reply in the newsgroup)
Thanks a HEAP,
Ron M.
some old sites with large numbers of static, text-based pages in a
UNIX or AIX environment. I use several Perl "tools" in my work,
although I'm not a Perl programmer.
Task: use the following Perl code to replace all occurrences of the
string, "this is the old string" with "this is the new string" and
create backup files with the ".back" suffix. Do this with all files
whose filename contains the string, ".html."
perl -pi.back -e 's/this is the old string/this is the new string/g'
*.html*
Problem: if, in the actual file, the string, "this is the old string"
is broken over two lines, the Perl code won't work! It has to be all
on the same line, or the text won't be replaced, and I have to go back
through each file one at a time and manually replace it in vi, which
is kinda self-defeating.
If it's possible, can somebody please change this Perl string so it
will catch those broken strings?
(please reply in the newsgroup)
Thanks a HEAP,
Ron M.