Since you're probably using XML::Simple, use ForceArray=>1 so the data structure it returns always contain arrays.
https://metacpan.org/pod/XML::Simple#ForceArray-=%3E-1-%23-in-importantIn reply to Re: hashref with(out) arrays
by virtualsue
in thread hashref with(out) arrays
by bfdi533
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |