#!/usr/bin/perl -w $tag= "al"; opendir (DIR_B, ".."); $c= 0; {TEMP: while(my $job_B=readdir(DIR_B)){ print "D $c\n"; next unless $job_B =~ /Out_$tag\.txt$/; } } print "DONE\n"; close (DIR_B);opendir (DIR_B, ".."); goto ("TEMP");