#!/net/perl/5.10.0/bin/perl use strict; use warnings; use YAML; use XML::Simple; my $teams = XMLin( do { local $/; }, ForceArray => [qw( football_team Player )], ); print Dump $teams; foreach my $team ( @{ $teams->{football_team} } ) { print "$team->{Name}\n"; foreach my $player ( @{ $team->{Players}{Player} } ) { print " $player->{ForeName} $player->{LastName}\n"; } } __DATA__ #### ONE 1990 12 04 Wonguso Jimm JW Fearless A AF New York TWO 1978 9 23 Pedro Therry TP Haywardis Richie RH Eswa Jeyan JE Leongus John JL Bentson Billie BB California #### --- football_team: - DateCreated: Day: 04 Month: 12 Year: 1990 Hometown: New York Name: ONE Players: Player: - ForeName: Jimm Initials: JW LastName: Wonguso - ForeName: A Initials: AF LastName: Fearless - DateCreated: Day: 23 Month: 9 Year: 1978 Hometown: California Name: TWO Players: Player: - ForeName: Therry Initials: TP LastName: Pedro - ForeName: Richie Initials: RH LastName: Haywardis - ForeName: Jeyan Initials: JE LastName: Eswa - ForeName: John Initials: JL LastName: Leongus - ForeName: Billie Initials: BB LastName: Bentson ONE Jimm Wonguso A Fearless TWO Therry Pedro Richie Haywardis Jeyan Eswa John Leongus Billie Bentson