thanks it now works. Question about adding "exit" command.
If I add it in the below area will it be a problem because I am
exiting without doing the "closedir(DIR)" filehandle??
PLease advise if this is okay??
if(!opendir(DIR,$startDir)){
print "No permission to open directory $startDir\n";
exit 0;
}else{ closedir(DIR); }