@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!
In reply to Hash of Hash Redux by BioNrd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |