# Matching a valid e-mail address[ A-z 0-9 and -,.,_,@ ] - no blank spaces # Allow IP addresses to included into the e-mail address # check_email_address ( $e-mail ) sub check_email_address { $email = $_[0]; # If the e-mail address contains: if ( $email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $email !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/ ) { return 0; } else { # Return a true value, e-mail verification passed. return 1; } }