sub process_files { if (opendir(TEST, $dir_path)) { @files = sort grep{$_ ne '.' and $_ ne '..'} readdir(TEST); #print "\n@files[0]\n"; for ($j = 0; $j <= $#files; $j++) { $file_path = $dir_path."\\".@files[$j]; read_files(); } } else { die ("Could not Opendir $!\n"); }closedir TEST; } sub read_files { if ($file_path =~ /defines|sccpch|sms81154|sms97767/) { next; } elsif(!($file_path =~ /defines|sccpch|sms81154|sms97767/)) { if (open(FILES, $file_path)) { if (!($file_path =~ /\.lfa|\.zip|\.txt|UASTG/)) { print (DATA "$file_path\n"); } } else { die ("Could not open[$file_path], $!\n"); } }close FILES; }