1#
2# Copyright(C) 1998
3# All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
4#
5# Permission from use, copy, modify, and distribute this
6# software and its documentation for EDUCATIONAL purposes
7# and without fee is hereby granted provided that this
8# copyright notice appears in all copies.
9#
10# date : January 1, 1998.
11# author : Salih Yurttas.
12#
13# hh_01.pl
14#
15
16
17use warnings;
18
19# create hashes of hashes
20%h_h = ( elizabeth => { final => 84,
21 midterm => 92, },
22 nathan => { final => 96,
23 midterm => 92, },
24 michael => { final => 73,
25 midterm => 77, },
26 john => { final => 71,
27 midterm => 69,
28 homework => 80, },
29 );
30
31# add one
32$h_h{jennifer} = { final => 90,
33 midterm => 88,
34 quizes => 100,
35 };
36
37# print hashes of hashes
38for $student (keys%h_h) {
39 print "$student: ";
40 for $grade (keys%{$h_h{$student}}) {
41 print "$grade = $h_h{$student}{$grade} ";
42 }
43 print "\n";
44}