Created
September 10, 2012 06:42
-
-
Save kimmel/3689276 to your computer and use it in GitHub Desktop.
simple text matching with index
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use v5.14; | |
use warnings; | |
use utf8::all; | |
use File::Slurp qw( read_file ); | |
my $pattern_list = do 'fw.pl'; | |
my @patterns = keys $pattern_list; | |
my $content = read_file( 'dracula.txt' ); | |
foreach my $term (@patterns) { | |
if ((index $content, $term) > -1) { | |
#say $term; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment