sub find_string { my ($file, $string) = @_; open my $fh, '<', $file or die "Can't open '$file': $!\n"; my $text = do {local $/; <$fh>}; return $text =~ /\Q$string/; }