Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!perl
use strict;
my @quotes = ('I have never let my schooling interfere with my education',
'The important thing is not to stop questioning',
);
my %results = ();
my $dirname = '/MY/DIR';
chdir('/MY/DIR') or die "$!";
opendir(DIR, '.') or die "Can't open $dirname: $!";
my @dirs = readdir(DIR);
close(DIR);
for(@dirs){
next if ($_ eq '.' or $_ eq '..');
open(FH,$_) or next;
my $string = do { local $/; <FH> };
close(FH);
foreach my $quotes (@quotes){
push @{$results{$_}},$quotes if ($string =~ /$quotes/i);
}
}
foreach my $files (sort keys %results) {
print "File '$files' has the following quotes:\n";
print "\t$_\n" for @{$results{$files}};
}