in reply to Re^4: need help with for loop within an xml
in thread need help with for loop within an xml

my $xml = do {local $/='';<DATA>} ; reads the lines following __DATA__ into a string.
Since your XML is in a separate file use my $servers = XMLin('file.xml',ForceArray => 1); and remove the __DATA__ line and all the lines following.

ForceArray=1 ensures $servers->{server} is an arrayref even if there is only one server block in the file.

See OPTIONS in XML::Simple
poj