$x=$y=0; $data_file='C:\scripts\sample_virus'; open(FH, "<:raw", $data_file) or die("Could not open file dumbass!"); @raw_data=; close(FH); $virus_defs='c:\scripts\signatures'; #puts signatures into array @def_input open(FH, "<:raw", $virus_defs) or die ("Could not open $virus_defs"); @def_input=; close(FH); $fileLen=scalar(@raw_data); #find number of file lines print "Array length: $fileLen\n"; foreach $line (@def_inputs) { #puts text file into a stepped array #print "x= $x\n"; @defs[$x]=$line; #print "@defs[$x]\n"; $x+=1; } print "\n"; $x=0; #reset counter foreach $line (@raw_data) { #compares line by line for virus if ($line eq @virus[$x]) { print "Infection line $x \n"; $x+=1; } { print "$line\n"; print "@virus[$x]\n"; } }