<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1015357" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1015357</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1090154</link>
    <description> &lt;p&gt;Hey, it worked!!&lt;br /&gt;
I just had to add&lt;br /&gt;
&lt;code&gt;$line--;&lt;/code&gt;&#039;&lt;br /&gt;
after&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$file = &amp;quot;$data_path\\news.txt&amp;quot;; &lt;br /&gt;$line = $FORM{&amp;#039;id&amp;#039;};&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Thanks!!!!&lt;/p&gt;
&lt;p&gt;--Edge&lt;/p&gt;
 </description>
     <pubDate>Wed, 19 Sep 2001 21:20:26 +0000</pubDate>
 <dc:creator>Edge</dc:creator>
 <guid isPermaLink="false">comment 1090154 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1090086</link>
    <description> &lt;p&gt;Quickie Code (untested)&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$file = &amp;quot;$data_path\\news.txt&amp;quot;; &lt;br /&gt;$line = $FORM{&amp;#039;id&amp;#039;}; &lt;br /&gt;&lt;br /&gt;open(IN,&amp;quot;&amp;lt;$file&amp;quot;); &lt;br /&gt;@array = &amp;lt;IN&amp;gt;; &lt;br /&gt;close(IN); &lt;br /&gt;&lt;br /&gt;$num_lines = @array;&lt;br /&gt;open(OUT,&amp;quot;&amp;gt;$file&amp;quot;); &lt;br /&gt;for ($i=0; $i&amp;lt;$num_lines; $i++) { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if($i != $line) { &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print OUT $array[$i]; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;}&lt;br /&gt;close(OUT);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Sep 2001 22:24:22 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1090086 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1090084</link>
    <description> &lt;p&gt;Okay, sorry for the slow reply, but forget the editing a particular line for a second. I&#039;m having more trouble deleting a particular line. Here&#039;s the code I&#039;m using:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$file = &amp;quot;$data_path\\news.txt&amp;quot;; &lt;br /&gt;$line = $FORM{&amp;#039;id&amp;#039;}; &lt;br /&gt;&lt;br /&gt;open(IN,&amp;quot;&amp;lt;$file&amp;quot;); &lt;br /&gt;@array = &amp;lt;IN&amp;gt;; &lt;br /&gt;close(IN); &lt;br /&gt;&lt;br /&gt;$num = 0; &lt;br /&gt;&lt;br /&gt;for (@array) { &lt;br /&gt;if($_ =~ /$line/) { &lt;br /&gt;splice(@array,$num,1); &lt;br /&gt;} &lt;br /&gt;$num++; &lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;open(IN,&amp;quot;&amp;gt;$file&amp;quot;); &lt;br /&gt;print IN @array; &lt;br /&gt;close(IN);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;That works great except when I tell it to delete line 1. In other words, $FORM{&#039;id&#039;} = 1. When do that, it goes and deletes every other line in the file. Otherwise, it&#039;s working perfectly.&lt;/p&gt;
&lt;p&gt;--Edge&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Sep 2001 22:07:58 +0000</pubDate>
 <dc:creator>Edge</dc:creator>
 <guid isPermaLink="false">comment 1090084 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1088927</link>
    <description> &lt;p&gt;Can you post the code you are using?  Or a link to the page?&lt;/p&gt;
 </description>
     <pubDate>Wed, 05 Sep 2001 06:34:04 +0000</pubDate>
 <dc:creator>tmay</dc:creator>
 <guid isPermaLink="false">comment 1088927 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1088869</link>
    <description> &lt;p&gt;Yeah, I tried the \? thing and it solved it. But, the problem with that was that when the script reads the file and displays it through my browser, it still shows the slash in from of the question mark.&lt;/p&gt;
&lt;p&gt;--Edge&lt;/p&gt;
 </description>
     <pubDate>Tue, 04 Sep 2001 22:15:09 +0000</pubDate>
 <dc:creator>Edge</dc:creator>
 <guid isPermaLink="false">comment 1088869 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1088684</link>
    <description> &lt;p&gt;Actually, I&#039;ll try to save you a step:  Just try putting a backslash (\) right in front of the question mark and see if that works now.  If that don&#039;t work, then post the regex with an example line of the file you are trying to edit.&lt;/p&gt;
 </description>
     <pubDate>Mon, 03 Sep 2001 19:21:03 +0000</pubDate>
 <dc:creator>tmay</dc:creator>
 <guid isPermaLink="false">comment 1088684 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1088683</link>
    <description> &lt;p&gt;Can you post the regex you are using now?  Question marks are used in Perl for matching.  I think Perl is reading it wrong depending on how you have it used.&lt;/p&gt;
 </description>
     <pubDate>Mon, 03 Sep 2001 19:07:49 +0000</pubDate>
 <dc:creator>tmay</dc:creator>
 <guid isPermaLink="false">comment 1088683 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1088674</link>
    <description> &lt;p&gt;That&#039;s what I&#039;m doing, but one part of my line has a question mark in it and somehow it&#039;s getting messed up when it replaces it. Is there something I should know about question marks??&lt;/p&gt;
&lt;p&gt;--Edge&lt;/p&gt;
 </description>
     <pubDate>Mon, 03 Sep 2001 17:09:43 +0000</pubDate>
 <dc:creator>Edge</dc:creator>
 <guid isPermaLink="false">comment 1088674 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/need-help-perl#comment-1088626</link>
    <description> &lt;p&gt;Do you have any experience with Perl?&lt;br /&gt;
Do you have any experience with regex?&lt;/p&gt;
&lt;p&gt;Basically, read the file into a $var.  Then use&lt;br /&gt;
$var = s/my_pattern/my_replacement/;&lt;br /&gt;
where &#039;my_pattern&#039; is a regex pattern that you are looking for, and &#039;my_replacement&#039; is what you want to replace it with.&lt;/p&gt;
 </description>
     <pubDate>Mon, 03 Sep 2001 06:08:25 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1088626 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
