if (scalar @newemails) { my ($email, $domain) = split(/\@/, $newemails[0]); mail($newemails[0], $domain); }