Gossamer Forum
Home : General : Perl Programming :

excluding free email

Quote Reply
excluding free email
would anybody care to share some code for excluding free email address from signing up to a newsletter.

example: i'd like to exclude all yahoo.com and usa.net email addresses from being able to join.

thanks in advance Wink
Quote Reply
Re: excluding free email In reply to
You could try something like this:
Code:
my $email = param("email"); # This being the user's submitted email address

$illegal_addies = ':yahoo.com:usa.net:hotmail.com:';
($user,$mail_server) = split(/\@/, $email);
$illegal_addies =~ /:${mail_server}:/i ? print "Bad Address.\n" : print "Valid Address\n";

-- Gordon --


------------------
$blah='82:84:70:77';
print chr($_) foreach (split/:/,$blah);

Quote Reply
Re: excluding free email In reply to
thx, i'll give it a try Wink