#!/usr/bin/perl use strict; use warnings; use Data::Dumper; ## This shows that if you test a multi-dimensional hash, ## Perl will "auto-vivify" the first dimension in the ## process of checking if the 2nd dimension exists. my %apps; $apps{"App1"}{Memory} = 4; $apps{"App1"}{Language} = 'Perl'; $apps{"App1"}{CPU} = '1.4'; $apps{"App1"}{Cores} = '2'; print "No App8 Cores\n" if !exists $apps{App8}{Cores}; print Dumper \%apps; __END__ No App8 Cores $VAR1 = { 'App8' => {}, <-- the exists() created this!!! 'App1' => { 'Memory' => 4, 'Cores' => '2', 'Language' => 'Perl', 'CPU' => '1.4' } };