if ( $array =~ /^\s*$/ ) { # true if line is empty or whitespace only .... }