in reply to dereferencing multiple hash array structure
Here is an extract from the data structure in DoxyDocs1.pm, re-formatted for greater readability and with one => re-written as quote + comma (see Comma Operator in perlop):
detailed => { doc => [ { type => 'text', content => 'Add a child to the container ' }, "params", [ { parameters => [ { name => 'child' } ], doc => [ { type => 'text', content => 'is the child element to add' } ] } ] ] },
As you can see, doc is a hash key with a reference to an anonymous array as its value. This array contains 3 elements: a reference to an anonymous hash; the string "params"; and a reference to an anonymous array. As GrandFather says, this is syntactically OK, but it is almost certainly not what was intended — which is why you’re unable to extract the data you want. You will need to re-consider the way this data structure is generated.
Update: Using prototypes on subroutines is usually a bad idea, unless you have a strong reason to. Better to remove the trailing parentheses from the definition of sub GenerateClassInfo; then call it without the & prefix.
HTH,
Athanasius <°(((>< contra mundum
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: dereferencing multiple hash array structure
by AnomalousMonk (Archbishop) on Jun 23, 2012 at 15:13 UTC |