Skip to content

Instantly share code, notes, and snippets.

@kimmel
Created September 10, 2012 02:57
Show Gist options
  • Save kimmel/3688579 to your computer and use it in GitHub Desktop.
Save kimmel/3688579 to your computer and use it in GitHub Desktop.
brute force all match patterns
#!/usr/bin/perl
use v5.14;
use warnings;
use utf8::all;
use File::Slurp qw( read_file );
...
my @patterns = map {qr/\b$_\b/ixms} keys $pattern_list;
my $content = read_file( $fname );
foreach my $term (@patterns) {
if ( $content =~ $term ) {
# post processing
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment