# Printing sources that do not match of of the terms: while (my $source = ) { chomp $source; print "$source\n" unless grep { $source =~ /$_/ } @terms; }