in reply to Help with Parsing XML output
For a quick and dirty fix for your problem, you could try
if (ref($var) eq 'ARRAY') { ... } elsif (ref($var) eq 'HASH') { ... } else { ... die "Var is of " . ref($var) . " type and will not be processed"; } [download]