<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1012306" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1012306</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/replacing-text#comment-1070921</link>
    <description> &lt;p&gt;your gonna want to parse the user input for&lt;br /&gt;
if they put that in their input, there will be instances of &lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$file = &amp;#039;C:\windows\desktop\data.txt&amp;#039;;&lt;br /&gt;{&lt;br /&gt;	local $/;&lt;br /&gt;	open(IN,$file) or die &amp;quot;Cannot open $file to read: $!&amp;quot;;&lt;br /&gt;	$html = &amp;lt;IN&amp;gt;;&lt;br /&gt;	close(IN);&lt;br /&gt;}&lt;br /&gt;$newinput = /&amp;lt;TOP&amp;gt;/&amp;amp;lt;TOP&amp;amp;gt;/g;&lt;br /&gt;$html =~ s/&amp;lt;TOP&amp;gt;/&amp;lt;TOP&amp;gt;\n$newinput&amp;lt;br&amp;gt;/;&lt;br /&gt;&lt;br /&gt;open(IN,&amp;quot;&amp;gt;$file&amp;quot;) or die &amp;quot;Cannot open $file to write: $!&amp;quot;;&lt;br /&gt;print IN $html;&lt;br /&gt;close(IN);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sun, 10 Sep 2000 23:31:59 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1070921 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/replacing-text#comment-1070857</link>
    <description> &lt;p&gt;Try using the following:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt; &lt;br /&gt;$file = &amp;#039;C:\windows\desktop\data.txt&amp;#039;;&lt;br /&gt;{&lt;br /&gt;	local $/;&lt;br /&gt;	open(IN,$file) or die &amp;quot;Cannot open $file to read: $!&amp;quot;;&lt;br /&gt;	$html = &amp;lt;IN&amp;gt;;&lt;br /&gt;	close(IN);&lt;br /&gt;}&lt;br /&gt;$html =~ s/&amp;lt;TOP&amp;gt;/&amp;lt;TOP&amp;gt;\n$newinput&amp;lt;br&amp;gt;/;&lt;br /&gt;&lt;br /&gt;open(IN,&amp;quot;&amp;gt;$file&amp;quot;) or die &amp;quot;Cannot open $file to write: $!&amp;quot;;&lt;br /&gt;print IN $html;&lt;br /&gt;close(IN);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;To search/replace use a regular expression like above&lt;br /&gt;
$variable =~ s/SEARCH FOR/REPLACE WITH/g;&lt;br /&gt;
the g modifier is optional, what it does is look more than once through a file to find what you are searching for. But considering there is only one  in your file, it is not required.&lt;/p&gt;
&lt;p&gt;Hope that helps.&lt;/p&gt;
 </description>
     <pubDate>Sat, 09 Sep 2000 12:40:12 +0000</pubDate>
 <dc:creator>Rob Pengelly</dc:creator>
 <guid isPermaLink="false">comment 1070857 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
