foreach $i (@allc) { chomp($i); if($i eq "aa\@xx.com") { next; } else { if($who =~ $i) { print qq(one $i); } else { print qq($i); } } }