foreach (@emails){ next unless $_; next if $_ =~ $ignore; push(@newemails, $_); } #### print Dumper \@emails; #### my ($email, $domain) = split(/\@/, $newemails[0]); #### &mail($newemails[0], $domain) if $newemails[0] and $domain;