<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1020873" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1020873</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/how-do-i-read-each-line-split-flatfile#comment-1128244</link>
    <description> &lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;# in this line the regex match is taking much longer than the chomp&lt;br /&gt;chomp ($line) if ($line =~ /\n$/);&lt;br /&gt;# why not just chomp (sorry nitpicking)&lt;br /&gt;&lt;br /&gt;# in answer to your question, try something like this&lt;br /&gt;my @stuff;&lt;br /&gt;open(FILE, &amp;#039;/path/to/file&amp;#039;) or die(&amp;quot;error opening file: $!&amp;quot;);&lt;br /&gt;while(&amp;lt;FILE&amp;gt;) {&lt;br /&gt;	chomp;&lt;br /&gt;	@line = split(/\|/);&lt;br /&gt;&lt;br /&gt;	# now you&amp;#039;d do something to determine if this @line is the stuff you want, if so break&lt;br /&gt;	if($thisiswhatimlookingfor) {&lt;br /&gt;		@stuff = @line;&lt;br /&gt;		last;&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;close FILE;&lt;br /&gt;&lt;br /&gt;#make sure we found stuff&lt;br /&gt;if($#stuff &amp;lt; 0) { die(&amp;quot;Couldn&amp;#039;t find the good stuff&amp;quot;); }&lt;br /&gt;&lt;br /&gt;# the data you want is now @stuff&lt;br /&gt;print &amp;quot;I have found stuff!&amp;quot;;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Tue, 01 Apr 2003 02:46:40 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1128244 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
