FYI, you could also change the sub to a function that returns the array of files. The calling code can then just check if any files are in the array.