use warnings; use strict; use Data::Dump; use XML::Simple qw/:strict XMLin/; dd XMLin('Foo',ForceArray=>[],KeyAttr=>[]); dd XMLin('', ForceArray=>[],KeyAttr=>[]); __END__ { x => { y => "Foo" } } { x => { y => "Foo" } }