Thank you this also works perfectly.
Can I just clarify why in the method/subroutine I need the index to $_. I tried it without and it doesn't work.
"sub { -e $_ }" instead of "sub { -e $_[0] }".
Why does the file parameter need to be referenced as index[0]?