I appreciate your response. I define $all_directories in another sub routine. I'm passing the vairable to the sub routine that it is going to find, copy and rename the files. I'm not familiar with passing variables between sub routines but I'll appreciate your suggestions.