in reply to Checking on multiple email addresses in a string

I guess you user would seperate their addresses with a space or a comma. I would check on that.

Something like:

#!/usr/bin/perl -w use strict; sub is_single { my $email = shift; # remove spaces from beginning and end $email =~ s/^\s*|\s*$//g; # check for characters invalid in an emailaddress return $email=~/[\s,]/?0:1; } # prints 1 print is_single('hpotter@hotmail.com'); # prints 0 print is_single('hpotter@hotmail.com, mickymouse@disney.com');

But I guess some people around here have a far more beautiful solution.

Update strict-ing the code and making it more verbose