You can check that with the ref function:
use strict; my $var = [qw(this is an array)]; print ref $var; my $var = "This is a scalar"; print ref $var; my $var = { message => "This is a scalar" }; print ref $var;
But you really, really want to use the ForceArray configuration parameter to make all your results arrays, whether there is one or more elements in the XML.
In reply to Re: Checking if a variable is an array
by Corion
in thread Checking if a variable is an array
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |