use warnings; use strict; use Test::More qw(no_plan); my $emailsregex = qr/\w+@\w+\.(net|com|org)/; while () { like($_, $emailsregex) } __DATA__ timmytimmers@aol.com hillary-hillers@aol.com garbygerbil@herbill.gerbil.org garbygerbil@herbill.gorgil.org reginald_reggers@aol.com