<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Irregular performance' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Irregular performance' posted on the 'Perl' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 22:56:28 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 22:56:28 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Irregular performance</title>
      <link>http://www.programmersheaven.com/mb/perl/412302/412302/irregular-performance/</link>
      <description>Code is stupid...but people get mad if you dont try before asking for help. I get 18 rands to scratch.dat most of the time. However, some of the time, the hourglass comes up and I get only 12 results. Your ideas?&lt;br /&gt;
I appreciate it.&lt;br /&gt;
----&lt;br /&gt;
$seen = 0;&lt;br /&gt;
    $reps = 1;&lt;br /&gt;
    while ($reps &amp;lt; 19)&lt;br /&gt;
    {&lt;br /&gt;
    $random_number = int(rand(336)) +1;&lt;br /&gt;
    if (-e "scratch.dat")&lt;br /&gt;
            {&lt;br /&gt;
        open (SCR, "scratch.dat") || &amp;amp;CgiDie ("SCRATCH could not be opened while attempting read");&lt;br /&gt;
        @scra =&amp;lt;SCR&amp;gt;;&lt;br /&gt;
        close (SCR);&lt;br /&gt;
            foreach $mine (@scra)&lt;br /&gt;
                {&lt;br /&gt;
            chomp($mine);&lt;br /&gt;
            ($junk, $num_to_check) = split (/\|/, $mine);&lt;br /&gt;
            if ($num_to_check == $random_number)&lt;br /&gt;
                    {&lt;br /&gt;
                    $seen = 1;&lt;br /&gt;
                    }&lt;br /&gt;
                }#end of foreach line&lt;br /&gt;
            }#end of if scratch data exists&lt;br /&gt;
            if ($seen == 0)&lt;br /&gt;
                {&lt;br /&gt;
                open (SCR, "&amp;gt;&amp;gt;scratch.dat") || &amp;amp;CgiDie ("SCRATCH could not be opened while attempting write");&lt;br /&gt;
                seek(SCR, 0, SEEK_END);&lt;br /&gt;
                print SCR "junk\|$random_number\n";&lt;br /&gt;
                close(SCR);&lt;br /&gt;
                $seen = 0;&lt;br /&gt;
                $reps++;&lt;br /&gt;
                }&lt;br /&gt;
        }# End of lets do 18 reps...&lt;br /&gt;
    #unlink ("scratch.dat");&lt;br /&gt;
    &amp;amp;printout;&lt;br /&gt;
    }&lt;br /&gt;
else&lt;br /&gt;
    {&lt;br /&gt;
    &amp;amp;signin;&lt;br /&gt;
        }</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/perl/412302/412302/irregular-performance/</guid>
      <pubDate>Tue, 26 Jan 2010 17:13:03 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Re: Irregular performance</title>
      <link>http://www.programmersheaven.com/mb/perl/412302/412405/re-irregular-performance/#412405</link>
      <description>I got it. $seen = 0; belongs after while. Otherwise seen remains one after the first duplicate is encountered and it goes on and on....&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/perl/412302/412405/re-irregular-performance/#412405</guid>
      <pubDate>Thu, 28 Jan 2010 10:47:27 -0700</pubDate>
      <category>Perl</category>
    </item>
  </channel>
</rss>
