$hsh{k1}{k2}{k3}{k4}=v1;
$hsh{k1}{k9}{k3}{k33}=v2;
....
####
if ( $hsh{ch1}{ch2}{ch3} ) { ...something... }
####
if ( $hsh{ch1} && $hsh{ch1}{ch2} && $hsh{ch1}{ch2}{ch3} )
{...}
####
DB<4> $h{a}{b}=[1,2]; $h{a}{c}=[3,4] #hash with two elements (arrays) and in 2 levels
DB<5> use Data::Dumper #good way to display
DB<6> p Dumper\($a,%h)
$VAR1 = \undef;
$VAR2 = {
'a' => {
'c' => [
3,
4
],
'b' => [
1,
2
]
}
};
DB<7> p 'da' if !$h{p}{m} #checking for an existent keys and element
da
DB<8> p Dumper\($a,%h)
$VAR1 = \undef;
$VAR2 = {
'p' => {}, # <<== created one !!!
'a' => {
'c' => [
3,
4
],
'b' => [
1,
2
]
}
};
DB<9> delete $h{p}