my @myfile = glob ('d:/Log/tmp/*.tmp'); foreach my $file (@myfile){ #... }