> Hi there, Howdy > > I need to substitute a string in a .rtf file with a string > from an HTML form. I thought about using placeholders in the > .rtf document and then searching and overwriting them with > the data from the HTML form. I tried it out with that code: > > #!/usr/bin/perl -w > open PASSWD, "test.rtf" > or die "nichts gefunden ($!) "; > > while (<PASSWD>) { > chomp; > if (/welt/) { > s/welt/mars/; > } > }
You are simply reading the file here, not writing anything to it. If you want a search and replace feature try this from the command line: perl -pi -e "s/welt/mars/" test.rtf HTH DMuey > > there aren't any warn messages from the compiler, but the > string "hallo welt" hasn't changed into "hallo mars". But > whats' wrong? Or is it a problem with the .rtf format? > > Mfg > Blackice > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]