while (my $data = $ss->getNextRow()) { # skip lines until we find a non-blank row next unless grep { ! /^\s+$/ } @$data; ... stuff ... }