Trying to extract info from an array or hash that is inside multiple hash and array structure in a perl module generated by doxygen. I can extract most everything except what is inside detailed -> doc -> params -> parameters in following DoxyDocs1.pm

Uncomment commented sections to see data trying to extract

Including small sample of code

#!/bin/perl use Data::Dumper; use warnings; require "DoxyDocs1.pm"; print "API Content Analyzer\n"; &GenerateClassInfo($doxydocs->{classes}); sub GenerateClassInfo() { my ($classes) = @_; foreach my $class (@$classes) { print "\nClass name is: $class->{name}\n"; foreach my $pubmeth (@{$class->{public_methods}->{members}}) { print "\n" if exists $pubmeth->{name}; print "\tpublic methods include: $pubmeth->{name}\n"; my ($key, $pmcontent) = each (@{$pubmeth->{detailed}->{doc} +}); print "\t\tdescription: $pmcontent->{content}\n" if exists +$pmcontent->{content}; # foreach my $pmp (@{$pubmeth->{detailed}->{doc}}) { # print "\t\t"; # print Dumper($pmp); # } print "\t\tkind: $pubmeth->{kind}\n"; print "\t\ttype: $pubmeth->{type}\n" if exists $pubmeth->{t +ype}; } foreach my $privmeth (@{$class->{private_methods}->{members}}) + { print "\n" if exists $privmeth->{name}; print "\tprivate methods include: $privmeth->{name}\n"; my ($key, $pmcontent) = each (@{$privmeth->{detailed}->{do +c}}); print "\t\tdescription: $pmcontent->{content}\n" if exists + $pmcontent->{content}; # foreach my $info (@{$privmeth->{detailed}->{doc}}) { # print "\t\t"; # print Dumper($info); # } print "\t\tkind: $privmeth->{kind}\n"; print "\t\ttype: $privmeth->{type}\n" if exists $privmeth- +>{type}; } } }

DoxyDocs1.pm

$doxydocs= { classes => [ { name => 'Panoply::Composite', public_methods => { members => [ { kind => 'function', name => 'addChild', virtualness => 'non_virtual', protection => 'public', static => 'no', brief => {}, 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' } ] } ] ] }, type => 'void', const => 'no', volatile => 'no', parameters => [ { declaration_name => 'child', type => 'Ptr' } ] }, { kind => 'function', name => 'operator<', virtualness => 'non_virtual', protection => 'public', static => 'no', brief => {}, detailed => { doc => [ { type => 'text', content => 'Less than operator' }, { type => 'parbreak' }, params => [ { parameters => [ { name => 'rval' } ], doc => [ { type => 'text', content => 'The ' }, { type => 'url', link => 'classPanoply_1_1Package', content => 'Package' }, { type => 'text', content => ' against which we are comparing th +is one. ' } ] } ], { return => [ { type => 'text', content => 'true if this.packageID < rval.packag +eID, false otherwise.' } ] } ] }, type => 'bool', const => 'yes', volatile => 'no', parameters => [ { declaration_name => 'rval', type => 'const Composite &' } ] }, ] }, private_methods => { members => [ { kind => 'function', name => 'addChild', virtualness => 'virtual', protection => 'private', static => 'no', brief => {}, 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 ' } ] }, { parameters => [ { name => 'parent' } ], doc => [ { type => 'parbreak' }, { type => 'text', content => 'is this own parent, except in weak + pointer format to avoid a memory leak' } ] } ] ] }, type => 'virtual void', const => 'no', volatile => 'no', parameters => [ { declaration_name => 'child', type => 'Ptr' }, { declaration_name => 'parent', type => 'Ptr' } ] }, ] }, } ] }; 1;

In reply to dereferencing multiple hash array structure by jccunning

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.