in reply to Reading Multiple Directories

You are assigning to @files first from '/dir1' and then you assign to @files from '/dir1/imgs' overwriting the original contents.    You need to use push instead of assignment.