while (<>) { chomp; next unless length; if ($_ < 0) { push @negatives, $_; } else { push @positives, $_; } }