http://www.perlmonks.org?node_id=662520


in reply to an ever-available file for opening

What if your turn it around and say "Does there exist a file that I can open?"

Start at the root directory and recurse till you find a file that your can open.

This thinking will strip out any dependence on a particular file and replace it with the seemingly broader assumption that "somewhere on this system, there exists a file that I can open".