#!/usr/bin/perl my @checklist; my @testfile; my $rulenames; open (FILE,"filename"); while () { next if ( $_ =~ /^ *$/ || $_ =~ /^#/ ); push @checklist , $_; } chomp @checklist; close (FILE); my $GrepList = join '|', map "($_)", @checklist; @ARGV = <*>; if (@ARGV) { undef $/; while (<>) { $_ =~ s/\n//; next unless ($_ =~ /$GrepList/i); print "$ARGV : $+\n"; } }