#!/usr/bin/perl use warnings; use strict; #regexp.pl print "Gimme the address of the directory:\n"; my $folder = <>; chomp $folder; opendir(DIR, $folder) or die "We got a problem: $!"; my @files = readdir(DIR); print "What's the phrase you're looking for?\n"; my $find = <>; chomp $find; my @found; foreach (@files){ open(FILE, $_); my @FILE = ; if (@FILE =~ /$find/i){ push (@found, $_); } else { next; } } print "Your query was found in the following files:\n"; print "@found\n";