#!/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> ){ # set i-modifier to ignore case if( $line =~ /\Q$check\E/i ){ print "ist enthalten\n"; last; } } close $fh;