if (ref($var) eq 'ARRAY') { ... } elsif (ref($var) eq 'HASH') { ... } else { ... die "Var is of " . ref($var) . " type and will not be processed"; }