#!perl use 5.012; # strict, // use warnings; use Test::More; for (qw/ test@gmail.com test.test@gmail.com test.test.test@gmail.com test.test.test.test@gmail.com test@subdomain.domain.com test.test@subdomain.domain.com test.test.test@subdomain.domain.com test@test@domain.example test,test@domain.example test@first.example,test@domain.example /, "contains\nnewline\@fake.address") { unlike $_, qr/\@.*\@|,|\..*\..*\.|\n/i, "test '$_'"; } done_testing; __END__ Possible attempt to separate words with commas at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 18. ok 1 - test 'test@gmail.com' ok 2 - test 'test.test@gmail.com' not ok 3 - test 'test.test.test@gmail.com' # Failed test 'test 'test.test.test@gmail.com'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'test.test.test@gmail.com' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' not ok 4 - test 'test.test.test.test@gmail.com' # Failed test 'test 'test.test.test.test@gmail.com'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'test.test.test.test@gmail.com' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' ok 5 - test 'test@subdomain.domain.com' not ok 6 - test 'test.test@subdomain.domain.com' # Failed test 'test 'test.test@subdomain.domain.com'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'test.test@subdomain.domain.com' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' not ok 7 - test 'test.test.test@subdomain.domain.com' # Failed test 'test 'test.test.test@subdomain.domain.com'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'test.test.test@subdomain.domain.com' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' not ok 8 - test 'test@test@domain.example' # Failed test 'test 'test@test@domain.example'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'test@test@domain.example' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' not ok 9 - test 'test,test@domain.example' # Failed test 'test 'test,test@domain.example'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'test,test@domain.example' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' not ok 10 - test 'test@first.example,test@domain.example' # Failed test 'test 'test@first.example,test@domain.example'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'test@first.example,test@domain.example' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' not ok 11 - test 'contains # newline@fake.address' # Failed test 'test 'contains # newline@fake.address'' # at C:\Users\peter.jones\Downloads\TempData\perl\pm.pl line 20. # 'contains # newline@fake.address' # matches '(?^ui:\@.*\@|,|\..*\..*\.|\n)' 1..11 # Looks like you failed 8 tests of 11.