$slotnumber=0; $dpdrivloc = "Trinity"; open(DPSLOTFILE, "< c:\\test.txt") or die "Can't open test.txt: $!"; while () { chomp; for $chunk (split) { print "$chunk\n"; if ($chunk eq $dpdrivloc) { print "We have a match folks!"; } } } #system("c:\\ipbat.bat"); close DPSLOTFILE;