#!perl $start_time = time; opendir(DIR, "."); while ($file = readdir(DIR)) { ($ext) = (split(/\./,$file))[3]; next if ($ext ne "gz"); $unzip = $file; $unzip =~ s/\.gz//; print "$file\t$unzip\n"; system("gunzip $file"); system("perl Scan2.pl $unzip >> Errors.log"); system("gzip $unzip"); } closedir(DIR); $end_time = time; $total_time = $end_time-$start_time; $minutes = int($total_time/60); $total_time = $total_time % 60; print "\nProcessing completed in $minutes:$total_time\n";