use strict; my $find = "word or string to find"; my $file; open $file, "<", "searchfile.txt"; print "Lined that matched $find\n"; while (<$file>) { if ($_ =~ /\Q$find\E/) { print "$_\n"; } }