in reply to •Re: Test for file(s): glob or -e?
in thread Test for file(s): glob or -e?
With that in mind, and after thinking over the problem some more, I came up with a test (update: the same test the ysth beat me to by 3 minutes) that seems to work:
if ( grep {-e} glob $file ) {...
In this way, if $file is a single filename that doesn't exist, it will fail on the -e test. If $file is multiple files, glob will see them all.
|
|---|