use strict; my $find = "word or string to find"; open FILE, "; print "Lined that matched $find\n"; for (@lines) { if ($_ =~ /$find/) { print "$_\n"; } }