in reply to Re: title sub
in thread title sub

Tks for the speedy reply. Yes, i have an html file, which i'd like to use as a template of sorts. I'd like to be able to substitute just what's between the title tags; just as your example mentioned. I'd like to change from <TITLE>HELLO</TITLE> to <TITLE>GOODBYE</TITLE>, and be able to edit to the file directly, instead of printing to the screen.

Replies are listed 'Best First'.
RE: RE: Re: title sub
by chromatic (Archbishop) on Jun 07, 2000 at 02:38 UTC
    If you want to change the file directly, the proper technique is to:
    • open a Read/Write filehandle to the file
    • read the file into a scalar
    • use a supplied regex to modify it
    • print the scalar to the filehandle
    The node How do I write to a file? in tue Q&A section on files may be of assistance.