in reply to Fast file and directory operations

You might check into File::Find. I'm not sure it'll be faster than using foreach to go through a file glob, but I suspect it may.