in reply to •Re: Re: Test for file(s): glob or -e?
in thread Test for file(s): glob or -e?

My Windows background has found me out...
$, = ', '; my @files; print ((-e $data)? $data : ((@files = glob $data) && ($data ne $files[ +0]))? @files : ()) if $data;

Prints $data if $data is a file. Prints the globbed $data only if the glob did some work. The whole statement is protected just in case $data is empty.