in reply to parsing complex xml structure with xml::simple

Happily, there is: ref will help you to identify an array reference. You could do something like this:

if (ref($detail->{Col}) eq 'ARRAY') { # do something } else { # do something else }

Update: Hmmph. I get up at 4:40 am and davorg still beat me to this answer, darn those timezone-advantaged monks! Plus, his answer is better. That ForceArray solution looks cool.


No good deed goes unpunished. -- (attributed to) Oscar Wilde

Replies are listed 'Best First'.
Re^2: parsing complex xml structure with xml::simple
by bfdi533 (Friar) on Aug 01, 2006 at 15:06 UTC

    This is a good solution. I know that for the most part that most of the items will NOT be contained in arrays so for the ones that I know about, this seems like just the ticket!

    Thanks!