I am not able to forcearray the .server. element unless I change the case of the .name.
XML::Simple treats elements or attributes named 'name', 'key' or 'id' in a special way by default. You would use the KeyAttr option to tell it not to, as explained in the documentation.
In your case, the ForceArray is working correctly, but array folding happens next and turns the array into a hash keyed on 'name'. If you don't want that then just turn off array folding.
This node may make that a bit clearer.
In reply to Re: XML::Simple element handling
by grantm
in thread XML::Simple element handling
by linwood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |