Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hash of Hashes (HoH)

#!/usr/bin/perl
use strict;
use warnings;

use Data::Dumper;

my %distance;
$distance{'New York'}{'London'} = 5_027;
$distance{'New York'}{'Bejin'}  = 10_100;
$distance{'Paris'}{'London'}    = 350;

print Dumper \%distance;
$VAR1 = {
          'Paris' => {
                       'London' => 350
                     },
          'New York' => {
                          'Bejin' => 10100,
                          'London' => 5027
                        }
        };