rekcah has asked for the wisdom of the Perl Monks concerning the following question:
Sorry its got lots of comments but it can do more than I want it to do for testing any help is greatly apreciated.#open(LOUTPUT,"lastoutput") or die "Unable To Open lastoutput File. #Please Ensure That This File Exists And Contains On One Line. This Fi +le #Must Only Contain Numbers"; #$number=<LOUTPUT>; $number=3; #close(LOUTPUT); $divisor = 2; test(); sub test() { # Un-Comment The Next Line For More Output #print("NUM=$number DIV=$divisor\n"); if ($number / $divisor == int($number / $divisor)) { # Number Is Prime if ($number == $divisor) { print("Prime $number\n"); # open(OUTPUT,">>output"); # print(OUTPUT "$number\n"); # close(OUTPUT); } # Number Is Not Prime $divisor = 2; $number = $number + 1; } $divisor = $divisor + 1; #sleep(1); test(); } # open(LOUTPUT,">lastoutput"); # print(LOUTPUT "$number"); # close(LOUTPUT);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Not Releasing Memory
by antirice (Priest) on Jul 02, 2003 at 08:12 UTC | |
|
Re: Perl Not Releasing Memory
by ant9000 (Monk) on Jul 02, 2003 at 08:17 UTC | |
|
Re: Perl Not Releasing Memory
by arthas (Hermit) on Jul 02, 2003 at 08:26 UTC | |
|
Re: Perl Not Releasing Memory
by Limbic~Region (Chancellor) on Jul 02, 2003 at 10:44 UTC | |
by Anonymous Monk on Jul 02, 2003 at 13:51 UTC | |
by Limbic~Region (Chancellor) on Jul 02, 2003 at 14:45 UTC | |
|
Re: Perl Not Releasing Memory
by Elian (Parson) on Jul 02, 2003 at 13:55 UTC | |
|
Re: Perl Not Releasing Memory
by rekcah (Initiate) on Jul 02, 2003 at 17:32 UTC |