my @stopwords = qw( longwordOne anotherLongWord thirdLongHere ); my $stopmatch = join( '|', @stopwords ); while( ) { next if /$stopmatch/i; print; }