Yurttas/PL/SL/perl/F/07/02/01/hh 00.pl

From ZCubes Wiki
Revision as of 19:04, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="perl" line start="1" enclose="div"># # Copyright(C) 1998 # All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. # # Pe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 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_00.pl
14#
15
16
17use warnings;
18
19# create hash of hash
20%h_h = ( apple => { id   => "A",
21                    order => 2, },
22         orange => { id   => "O",
23                     order => 3, },
24         peach => { id    => "PE",
25                    order  => 1,
26                    special => "pe-1" },
27       );
28
29# add one
30$h_h{plum} = { id   => "PL",
31               order => 6,
32               origin  => "Aisa",
33             };
34
35# print hashes of hashes
36for $fruit (keys%h_h) {
37  print "$fruit: ";
38  for $id (keys%{$h_h{$fruit}}) {
39    print "$id = $h_h{$fruit}{$id} ";
40  }
41  print "\n";
42}