<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1016886" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1016886</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/data-sorting-perl#comment-1098268</link>
    <description> &lt;p&gt;My final solution and making use slternation concept in grep&lt;br /&gt;
i.e. $line=~/(00|15|29|44|33)$/; will go further.......&lt;br /&gt;
#!usr/bin/perl&lt;br /&gt;
print &quot;Content-type: text/html\n\n&quot;; &lt;/p&gt;
&lt;p&gt;@matching_num=qw(00 15 29 44 33)&lt;br /&gt;
$alternate_choice=join (&quot;|&quot;, @matching_num);&lt;br /&gt;
open(FILE, &quot;$filename&quot;);&lt;br /&gt;
@all = ;&lt;br /&gt;
while (@all){&lt;br /&gt;
chomp ;&lt;br /&gt;
if(/(\D)/){print&quot;It should input numbers&quot;;exit 0;}&lt;br /&gt;
else{print &quot;$_\n&quot; if /($alternate_choice)$/;}&lt;br /&gt;
}&lt;br /&gt;
close(FILE); &lt;/p&gt;
&lt;p&gt;Thanks for everyone&#039;s response...&lt;/p&gt;
 </description>
     <pubDate>Mon, 14 Jan 2002 23:41:00 +0000</pubDate>
 <dc:creator>uatt</dc:creator>
 <guid isPermaLink="false">comment 1098268 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/data-sorting-perl#comment-1098249</link>
    <description> &lt;p&gt;&lt;strong&gt;\d+&lt;/strong&gt; is going to be far less greedy.&lt;/p&gt;
&lt;p&gt;But I would just omit this part altogether. We&#039;re assuming that all lines are numbers in the same format. Why just not use&lt;/p&gt;
&lt;p&gt;if ($line =~ /\$num$/) {&lt;br /&gt;
..&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
 </description>
     <pubDate>Mon, 14 Jan 2002 20:25:47 +0000</pubDate>
 <dc:creator>Wil</dc:creator>
 <guid isPermaLink="false">comment 1098249 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/data-sorting-perl#comment-1098247</link>
    <description> &lt;p&gt;After more thought...&lt;/p&gt;
&lt;p&gt;I would change this:&lt;br /&gt;
if ($line=~ /\d*\$num$/) {&lt;br /&gt;
to:&lt;br /&gt;
if ($line=~ /^(\d)*($num)$/) {&lt;br /&gt;
for better readability, and, just in case ^(\d)* is too greedy, I would change it further to:&lt;br /&gt;
if ( ($line=~ /^(\d)*/) &amp;amp;&amp;amp; ($line=~ /($num)$/) ) { &lt;/p&gt;
&lt;p&gt;print &quot;$line\n&quot;; &lt;/p&gt;
&lt;p&gt;} # end if&lt;/p&gt;
 </description>
     <pubDate>Mon, 14 Jan 2002 19:12:10 +0000</pubDate>
 <dc:creator>cmix</dc:creator>
 <guid isPermaLink="false">comment 1098247 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/data-sorting-perl#comment-1098246</link>
    <description> &lt;p&gt;#!usr/bin/perl&lt;br /&gt;
print &quot;Content-type: text/html\n\n&quot;; &lt;/p&gt;
&lt;p&gt;@matching_num=qw(00 15 29 44 33) &lt;/p&gt;
&lt;p&gt;open(FILE, &quot;$filename&quot;);&lt;br /&gt;
@all = ;&lt;br /&gt;
close(FILE); &lt;/p&gt;
&lt;p&gt;foreach $line (@all){&lt;br /&gt;
  chomp $line; # not sure about this&lt;br /&gt;
  foreach $num (@matching_num){&lt;br /&gt;
    # I think you need an IF statement&lt;br /&gt;
    if ($line=~ /\d*\$num$/) { print &quot;$line\n&quot;; }&lt;br /&gt;
  }# end foreach&lt;br /&gt;
} # end foreach&lt;/p&gt;
 </description>
     <pubDate>Mon, 14 Jan 2002 18:46:59 +0000</pubDate>
 <dc:creator>cmix</dc:creator>
 <guid isPermaLink="false">comment 1098246 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
