Originally posted by smannell
In Perl, you can open an existing file for reading, or appending; but to the best of my knowledge not for modifying.
Thanks very much for your response smannell. Very much appreciated.
I toyed with appending and then substitution in a Perl script but to no avail.
, it always adds to the last line in the file. <base href=http://www.abc.com> in the last line is pretty useless.
Your comment that "appending can't modify" finally enlightened me that this is not the way to go.
, I don't know why but it just didn't work!
For example, I want to replace <head> with <head><base href=http://www.abc.com>
(which in effect adds the base href tag after the head tag)
Nothing was changed at all.