#!perl -w # "-w" turns on all sorts of warnings about probable errors. $dir = "r:\\\\40K\\"; sub listdirectory { local($dir); local(@lines); local($subdir); local($lvl_counter); local($list_length); $dir = $_[0]; if(opendir (DIR, $dir)) { @lines = readdir (DIR); closedir (DIR); $lvl_counter = 2; $list_length = ( scalar @lines ); while ($lvl_counter < $list_length) { $subdir = $dir."\\".$lines[$lvl_counter]; if(opendir (SUBDIR, $subdir)) { closedir (SUBDIR); &listdirectory($subdir); } else { print "$subdir\n"; } $lvl_counter++; } } } &listdirectory($dir); #### read_import_test.pl r:\\40K\\A400332S1_05.pdf r:\\40K\\A400332S2_05.pdf r:\\40K\\A400332S3_05.pdf r:\\40K\\A400396S1_07.pdf r:\\40K\\A400396S2_07.pdf