Quantcast
Channel: dereferencing a XML::Simple hash - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Miller for dereferencing a XML::Simple hash

In that data structure, the author points at an array reference. Therefore, you'll need to either iterate over the array or just dereference it before printing:foreach $book (@{$booklist->{book}} )...

View Article



Answer by Leeft for dereferencing a XML::Simple hash

As the author key is an array ref, you need to dereference those too:foreach my $book ( @{ $booklist->{ book } } ) { foreach my $author ( @{ $book->{ author } } ) { print "$author\n"; }}

View Article

dereferencing a XML::Simple hash

I have an XML file that looks like this <booklist><book type="technical"><author>Book 1 author 1</author><author>Book 1 author 2</author><title>Book 1...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images