open(OUTother, "<", "C:/Perl/MyScripts/tmp.txt") or die "Couldn't open file: $!"; my $hold2 = join "|", map /(\w+\.bld)/, ; close OUTother; open EGREP, "egrep -wn '$hold2' nbsssbs//esel/bld/*.bld nbsssbs/sbc/bld/*.bld nbssbts/btsc/bld/*.bld |" or die "Pipe to egrep failed: $!"; my @othersblds = ; close EGREP;