BioNrd has asked for the wisdom of the Perl Monks concerning the following question:
@populations = (4); &gener(); sub gener { foreach ($populations) { @chroma = (0...10); @chromb = (0...10); @ind = (0...10); %HoH = ( @populations => { individual => "@ind", chromasome1 => "@chroma", chromosome2 => "@chromb", }, ); } for $population ( sort keys %HoH ) { for $info ( sort keys %{ $HoH{$population} } ) { print "$population: $info=$HoH{$population}{$info} "; + } print "\n"; } use Data::Dumper; print Dumper(%HoH); }
Once this is working I also need a way to reference @chroma, @chromb, @ind for each population to modify them.
Thanks for your help!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash of Hash Redux
by moritz (Cardinal) on Oct 31, 2007 at 14:50 UTC | |
|
Re: Hash of Hash Redux
by johngg (Canon) on Oct 31, 2007 at 15:17 UTC | |
by BioNrd (Monk) on Oct 31, 2007 at 18:24 UTC | |
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 GrandFather (Saint) on Oct 31, 2007 at 20:00 UTC | |
|
Re: Hash of Hash Redux
by shmem (Chancellor) on Oct 31, 2007 at 15:10 UTC |