in reply to XMLin : Optimal Way to tell the difference between Array vs Scalar

Yes. Add the ForceArray => 1 option on the constructor, then XML::Simple will always return an array even if it only contains one element. See the POD for details.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re: XMLin : Optimal Way to tell the difference between Array vs Scalar
  • Download Code

Replies are listed 'Best First'.
Re^2: XMLin : Optimal Way to tell the difference between Array vs Scalar
by tptass (Sexton) on Aug 20, 2008 at 00:11 UTC

    Thanks BrowserUK, I somehow missed that entire section on ForceArray and ForceContent. Need to look a little hard next time before posting. Thanks for the Help!