in reply to opendir slower than ls on large dirs?

I'm trying to check if a file is in a directory with a lot of files (about 15 000).

Can't you just do this?

if (-e $filepath) { ... }