in reply to Getting all emails

my $result; for my $file (glob "*.html") { open (FH,"<$file") or die; while (<FH>) { $result += (my @matches = /@(\S+\.)?company.com/g); } close FH; } print "$result\n";
The regexp given is fairly naive, but you can improve on it.