Nested hashes : Hash Collections « Hash « Perl






Nested hashes

    

%students=( "Math"    => { "A"  => 100,   "B" => 95 },
             "Science" => { "C" => 85,     "D"  => 76 }
           );
print qq/$students{Math}->{Joan}.\n/;
print qq/$students{Science}->{Bill}.\n/;

   
    
    
    
  








Related examples in the same category

1.Hash of list
2.Hash of Hashes
3.Hash of Hashes with Lists of Values
4.List of hash
5.Use hash as an array