my $tmp = $parse->parse($address); #### use strict; use warnings; use XML::Parser; use Data::Dumper; my $parse = new XML::Parser(Style => 'Objects'); my $address = "Eagle WayGotham City"; print Dumper $parse->parse($address); #### C:\tmp>test.pl $VAR1 = [ bless( { 'Kids' => [ bless( { 'Kids' => [] }, 'main::HNO' ), bless( { 'Kids' => [ bless( { 'Text' => 'Eagle Way' }, 'main::Characters' ) ] }, 'main::STN' ), bless( { 'Kids' => [ bless( { 'Text' => 'Gotham City' }, 'main::Characters' ) ] }, 'main::MCN' ) ] }, 'main::LOC' ) ]; #### use strict; use warnings; use XML::Simple; use Data::Dumper; my $address = "Eagle WayGotham City"; my $ref = XMLin($address); print Dumper $ref; #### C:\tmp>test.pl $VAR1 = { 'MCN' => 'Gotham City', 'HNO' => {}, 'STN' => 'Eagle Way' };