# taken from the cookbook: sub glob2pat { my( $globstr ) = @_; my %patmap = ( '*' => '.*', '?' => '.', '[' => '[', ']' => ']', ); $globstr =~ s{(.)} { $patmap{$1} || "\Q$1" }ge; return '^' . $globstr . '$'; } ... my %ignore = map { glob2pat( $_ ) => 0 } @list_regexps; ... while() { chomp; my( @cols ) = split(" ", $_); my $do_not_print; ... foreach my $regexp ( keys %ignore ) { next if( $do_not_print ); if ( $cols[0] =~ m/$regexp/ ) { $ignore{$regexp}++; $do_not_print++; } } next if( $do_not_print ); }