in reply to Using directory handles in recursive functions

Remove the files from the filehandle and into a data structure so you can reopen the filehandle:

opendir(DIR, $dir); my (@filenames) = grep(!/^\.\.?$/, readdir(DIR)); closedir(DIR); for (@filenames) { ... something ... }

You may also want to look at File::Find. Or File::Recurse, or one of the File::* modules :)

Cheers,
KM