my @list = glob($dir . '/*.gz'); foreach my $file (@list) {