A sample hash would be like this:
We don't know how many levels each dimension goes, how to loop through it?
I guess recursive call could be the answer. But I don't know how to implement it exactly.
Could someone show me a sample code?
Many thanks.
Code:
my %hash = (
'key1'=>'val1',
'key2'=>{
'key21'=>'val21',
'key22'=>'val22',
'key23'=>{
'key231'=>'val231',
'key231'=>'val232',
},
'key24'=>'val24',
},
'key3'=>'val3',
);
I guess recursive call could be the answer. But I don't know how to implement it exactly.
Could someone show me a sample code?
Many thanks.