if (! @array) { # there are NO elements, do what you need to do } elsif (grep ! /^\s*$/, @array) { # there are elements in your array, and at least one # of them contains a string that has something other # than spaces } else { # there are elements in your array, but they are either # empty strings, or strings with spaces }