in reply to validating email address problem
Modules such as Data::Validate::Email are the preferred way to do that trick.
However if I take your code and make it into a runable sample:
use strict; use warnings; my $value = 'me.you@mydom.com'; if ($value =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.) / || $value !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})( +\]?)$/ ) { print "Bad email\n"; } else { print "Good email\n"; }
it prints:
Good email
which is not quite what you describe.
|
|---|