For the example you posted and assuming you want $response->{Item}->{ID} to be an array ref, davido's solution is probably the easiest - just force XML::Simple to return an array regardless of the number of elements.
If you need a more generalized solution, take a look at the ref function. It will allow you to check references like this:
if( ref( $var ) eq 'ARRAY' ) { # $var is a ref to an array }
HTH
In reply to Re: Error Checking for Array Reference
by bobf
in thread Error Checking for Array Reference
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |