- or download this
my %hash = ();
$hash{'foo'} = undef;
...
} else {
print "The key 'foo' is false.\n";
}
- or download this
my %inner_hash = ( dir => '/tmp/foo/', filename => 'bar.txt' );
my %hash_of_hashes = ();
...
$hash_of_hashes{'baz'} = \%inner_hash; # Backslash = reference to
print "The filename associated with 'baz' is " .$hash_of_hashes{'baz'
+}->{'filename'} . "\n";
- or download this
my $entry = { firstname => 'Ola', lastname => 'Nordmann' };
my $staff = {};
...
$staff->{$id}->{'lastname'},
$staff->{$id}->{'firstname'}
);