Hi,
I can't Goggle any examples of an 'array of associative arrays'. Referencing an element isn't too hard - for example:
x = $cars{$color}[$year]
My problem is trying to recurse the entire structure:
for ($yr = 1960; $yr <= 2003; $yr++) {
foreach $color (keys(%cars[$yr])) {
x = $cars{$color}[$yr]
}
}
The argument to my kes() function is what's choking. I tried %cars{}[$yr] which also failed. Basically, I need the syntax to specify an entire asso. array that is within a larger array (non asso.).
-with thanks
Mike
My error is:
Can't use subscript on hash deref at ./userDetailed.pl line 73, near "$hr]"
(Did you mean $ or @ instead of %?)
Type of arg 1 to keys must be hash (not array element) at ./userDetailed.pl line 73, near "])"
I can't Goggle any examples of an 'array of associative arrays'. Referencing an element isn't too hard - for example:
x = $cars{$color}[$year]
My problem is trying to recurse the entire structure:
for ($yr = 1960; $yr <= 2003; $yr++) {
foreach $color (keys(%cars[$yr])) {
x = $cars{$color}[$yr]
}
}
The argument to my kes() function is what's choking. I tried %cars{}[$yr] which also failed. Basically, I need the syntax to specify an entire asso. array that is within a larger array (non asso.).
-with thanks
Mike
My error is:
Can't use subscript on hash deref at ./userDetailed.pl line 73, near "$hr]"
(Did you mean $ or @ instead of %?)
Type of arg 1 to keys must be hash (not array element) at ./userDetailed.pl line 73, near "])"