open(OUTother, "< C:/Perl/MyScripts/tmp.txt") || die "Could not open file : $!\n"; my @hold2; while () { push(@hold2, $1) && last if (m/(\w+\.bld)/); } `egrep -wn @hold2 nbsssbs//esel/bld/*.bld nbsssbs/sbc/bld/*.bld nbssbts/btsc/bld/*.bld > $temp/otherblds2.txt `; close(OUTother) or die("Can't close file: $!");