use strict; open (my $IN,'<'.'report.xml'); my @array=(<$IN>); close $IN; for (my $i=0;$i<@array;$i+=1){ if(@array[$i]=='HALLO') { print "match"; } }