use strict; use XML::Simple qw(:strict); my $xml =q( 0596001320 Learning Perl, 3rd Edition Randal L. Schwartz Tom Phoenix 1565922204 Advanced Perl Programming Sriram Srinivasan 076455106X Guitar for Dummies Mark Phillips John Chappell ); my $library = XMLin($xml); foreach my $book (@{$library->{book}}) { print "$book->{title}\n"; print " $_\n" foreach(@{$book->{author}}); }