in reply to Re: Hash of Hash Redux
in thread Hash of Hash Redux
I have another thing...of course...the life of a noobie
I want to now make @ind, @chroma @chromb interactive for each population
Here is the sub...for my $poper (1 .. $popCt) { input(); gener(@chroma, @chromb, @ind); }
sub input { my ($upper, $lower); my $center = 1; print 'Enter lower bound: '; chomp ($lower = <STDIN>); print 'Enter upper bound: '; chomp ($upper = <STDIN>); my $ranpop; while ($center--) { $ranpop = int rand($upper - $lower + 1) + $lower; print $ranpop . "\n"; my @ind = (1...$ranpop); my $limiter = 50; while ($ranpop) { my $genea = int rand ($limiter); push(my @chroma, $genea); my $geneb = int rand ($limiter); push(my @chromb, $geneb); $ranpop--; } return @chroma, @chromb, @ind; } }
Also you all can yell at me all you want about use strict...no perl books have told me how to do that! I am flying without a net! Any good references?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Hash of Hash Redux
by johngg (Canon) on Oct 31, 2007 at 19:20 UTC | |
by BioNrd (Monk) on Nov 01, 2007 at 00:17 UTC | |
by graff (Chancellor) on Nov 01, 2007 at 05:27 UTC | |
by BioNrd (Monk) on Nov 01, 2007 at 13:23 UTC | |
by graff (Chancellor) on Nov 03, 2007 at 04:10 UTC | |
| |
|
Re^3: Hash of Hash Redux
by GrandFather (Saint) on Oct 31, 2007 at 20:00 UTC |