in reply to check array reference empty

It's unclear to me what you want, but then again, I can't seen to focus right now.

If $arr_ref is an array reference, and you want to check if there are any elements in the referenced array, the following will do:

if (@$arr_ref)

If $arr_ref can be either undef or an array reference, and you want to check if there are any elements in the referenced array (if any), the following will do:

if ($arr_ref && @$arr_ref)

If $arr_ref can be either undef or an array reference, and you want to check if it's an array reference, the following will do:

if ($arr_ref)