1. Is this the correct way to write this data structure? Suggestions?
2. How do I access the size of the 'disallowed' array?
3. What is the best way to foreach this array?
my %t_type = (
'a' => {
'chance' => {'low' => 2, 'high' => 12, 'percent' => 50},
'range' => {'number' => '','disallowed' => ['none','1','2']},
}
);
print "$t_type{'a'}{'magic'}{'disallowed'}[2] \n";
I am not having problems accessing the array slice but getting the entire array info is proving troublesome.
thanks in advanced
2. How do I access the size of the 'disallowed' array?
3. What is the best way to foreach this array?
my %t_type = (
'a' => {
'chance' => {'low' => 2, 'high' => 12, 'percent' => 50},
'range' => {'number' => '','disallowed' => ['none','1','2']},
}
);
print "$t_type{'a'}{'magic'}{'disallowed'}[2] \n";
I am not having problems accessing the array slice but getting the entire array info is proving troublesome.
thanks in advanced