wog,
Thanks for all your useful suggestions. The elseif statement was a goof on my part. I originally tested the code without this statement, but added it afterwards to catch emails with no email addresses and didn't test it since. Of course it failed along with a few other things that I found wrong with my code.
I was thinking about adding a foreach loop also, I've just been spending so much time trying to get the whois working. I think I will use
Mail::Send instead of sendmail. The reason I use sendmail is because the perldoc FAQ recommends it: perldoc -q "send mail" but I figure this was written before
Mail::Send because they also recommend
Mail::Mailer.
note that there are many valid emails that your regex won't match (search for a node on e-mail validation to see why).
I already inquired about the email problem
Matching any Email Address. I know this regex would not match all email addresses, but it has matched everyone for me so far.
Again, thanks for the help and I plan on implementing most if not all of your recommendations.
-Dru