#!/usr/bin/perl use strict; use warnings; my $file = '/path/to/file'; my $check = 'Restore Database'; open my $fh,'<',$file or die $!; while( my $line = <$fh> ){ if( $line =~ /\Q$check\E/ ){ print "ist enthalten\n"; last; } } close $fh;