Assuming your data in memory looks like:
my $parsed = {
A => {
B => {
C => [ qw/here is your list/ ],
},
},
};
Then you can get your list with my @list = @{ $parsed->{A}{B}{C} }
.
Is this what you are trying to do?
Edit: taking into account some of the comments, perhaps you want
Data::Visitor::Callback.
You can then extract all the arrays like:
my @arrays;
my $v = Data::Visitor::Callback->new(
array => sub { push @arrays, $_ },
);
$v->visit( $parsed_xml );
After that runs, \@arrays will be a list of references to
arbitrarily-deeply nested arrays.
Finally, if you just have an attribute name and want to search for
matching XML nodes, you really want XPath:
use XML::LibXML;
my $parser = XML::LibXML->new;
my $doc = $parser->parse_string( $xml_string );
# yeah, I am naming the variable data. so there.
my @data = map { $_->textContent } $doc->findnodes('//p[@id="foo"]');
Anyway, TMTOWTDI. If you are working with XML, and want to do
something complicated, XML::Simple is rarely the right answer. I use
XML::LibXML for everything, since it's nearly always easier.
One more thing, you may want
Data::DPath. It lets
you "XPath" an in-memory perl data structure: